1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-27 07:06:13 +01:00

Merge pull request #727 from lethliel/version_in_osc_maintained

print verion in osc maintained if --version is given
This commit is contained in:
Marco Strigl 2020-02-06 11:05:23 +01:00 committed by GitHub
commit ff7b64d5eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3327,6 +3327,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
@cmdln.option('--nodevelproject', action='store_true',
help='do not follow a defined devel project ' \
'(primary project where a package is developed)')
@cmdln.option('--version', action='store_true',
help='print version of maintained package')
@cmdln.alias('sm')
@cmdln.alias('maintained')
def do_mbranch(self, subcmd, opts, *args):
@ -3384,6 +3386,12 @@ Please submit there instead, or use --nodevelproject to force direct submission.
if opts.dryrun:
for r in result.findall('package'):
line="%s/%s"%(r.get('project'), r.get('package'))
if opts.version:
sr = get_source_rev(apiurl, r.get('project'), r.get('package'))
version = sr.get('version')
if not version or version == 'unknown':
version = 'unknown'
line = line + (' (version: %s)' % version)
for d in r.findall('devel'):
line+=" using sources from %s/%s"%(d.get('project'), d.get('package'))
print(line)