From ef2d5959fc6f78a88f49420a9d852097010a6b26 Mon Sep 17 00:00:00 2001
From: Danny Kukawka
Date: Wed, 21 Apr 2010 15:58:57 +0200
Subject: [PATCH] get apiurl for 'osc my' from checked out package
Get apiurl for 'osc my' from checked out package if possible.
Make sure that global option -A works to in a checked out
package.
Signed-off-by: Danny Kukawka
---
osc/commandline.py | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/osc/commandline.py b/osc/commandline.py
index 4ce1109..c30c47c 100644
--- a/osc/commandline.py
+++ b/osc/commandline.py
@@ -3978,6 +3978,11 @@ Please submit there instead, or use --nodevelproject to force direct submission.
elif opts.all and (opts.bugowner or opts.maintainer):
raise oscerr.WrongOptions('Sorry, \'--all\' and \'--bugowner\' or \'--maintainer\' are mutually exclusive')
+ if is_package_dir(os.getcwd()) and not self.options.apiurl:
+ apiurl = store_read_apiurl(os.curdir)
+ else:
+ apiurl = conf.config['apiurl']
+
exclude_projects = []
for i in opts.exclude_project or []:
prj = i.split(',')
@@ -3986,7 +3991,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
else:
exclude_projects.extend(prj)
if not opts.user:
- user = conf.get_apiurl_usr(conf.config['apiurl'])
+ user = conf.get_apiurl_usr(apiurl)
else:
user = opts.user
@@ -3997,7 +4002,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
elif type in args_prj:
what = {'project': ''}
elif type in args_sr:
- requests = get_request_list(conf.config['apiurl'], req_who=user, exclude_target_projects=exclude_projects)
+ requests = get_request_list(apiurl, req_who=user, exclude_target_projects=exclude_projects)
for r in requests:
print r.list_view()
return
@@ -4014,7 +4019,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
if opts.all:
role_filter = ''
- res = get_user_projpkgs(conf.config['apiurl'], user, role_filter,
+ res = get_user_projpkgs(apiurl, user, role_filter,
exclude_projects, what.has_key('project'), what.has_key('package'))
request_todo = {}
roles = {}
@@ -4031,7 +4036,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
roles[i.get('name')] = [p.get('role') for p in i.findall('person') if p.get('userid') == user]
if list_requests:
- requests = get_user_projpkgs_request_list(conf.config['apiurl'], user, projpkgs=request_todo)
+ requests = get_user_projpkgs_request_list(apiurl, user, projpkgs=request_todo)
for r in requests:
print r.list_view()
else:
--
1.5.6
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-buildservice+help@opensuse.org