1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-27 02:16:12 +01:00

osc jobhistory accepts now also PRJ [PKG] REPO ARCH - enables query if not in wd.

This commit is contained in:
Jan-Simon Möller 2009-11-06 18:47:54 +00:00
parent fbf63aae84
commit 7769144d55
2 changed files with 31 additions and 10 deletions

1
NEWS
View File

@ -16,6 +16,7 @@
- support http proxies when using python 2.6 or newer (#551004) - support http proxies when using python 2.6 or newer (#551004)
- partial fix for checkout problems (bnc#551147) - partial fix for checkout problems (bnc#551147)
- fixed #477690 ("osc fetching binaries really slow") - fixed #477690 ("osc fetching binaries really slow")
- osc jobhistory accepts also "prj [pkg] repo arch" now
# #
# Features which require OBS 1.7 # Features which require OBS 1.7
# #

View File

@ -2834,24 +2834,44 @@ Please submit there instead, or use --nodevelproject to force direct submission.
@cmdln.option('', '--csv', action='store_true', @cmdln.option('', '--csv', action='store_true',
help='generate output in CSV (separated by |)') help='generate output in CSV (separated by |)')
@cmdln.alias('jobhist') @cmdln.alias('jobhist')
def do_jobhistory(self, subcmd, opts, repository, arch): def do_jobhistory(self, subcmd, opts, *args):
"""${cmd_name}: Shows the job history of a project """${cmd_name}: Shows the job history of a project
The arguments REPOSITORY and ARCH can be taken from the first two columns The arguments REPOSITORY and ARCH can be taken from the first two columns
of the 'osc repos' output. of the 'osc repos' output.
${cmd_usage} usage:
osc jobhist REPOSITORY ARCHITECTURE (in project dir)
osc jobhist PROJECT [PACKAGE] REPOSITORY ARCHITECTURE
${cmd_option_list} ${cmd_option_list}
""" """
wd = os.curdir wd = os.curdir
project = store_read_project(wd) args = slash_split(args)
package = None
try: if len(args) == 4:
package = store_read_package(wd) apiurl = conf.config['apiurl']
except: project = args[0]
pass package = args[1]
apiurl = store_read_apiurl(wd) repository = args[2]
arch = args[3]
elif len(args) == 3:
apiurl = conf.config['apiurl']
project = args[0]
package = None # skipped = prj
repository = args[1]
arch = args[2]
elif len(args) == 2:
package = None
try:
package = store_read_package(wd)
except:
pass
project = store_read_project(wd)
repository = args[0]
arch = args[1]
apiurl = store_read_apiurl(wd)
else:
raise oscerr.WrongArgs('Wrong number of arguments')
format = 'text' format = 'text'
if opts.csv: if opts.csv: