1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-02 17:56:15 +01:00

- do_detachbranch: added --message option; added some more error handling

This commit is contained in:
Marcus Huewe 2011-02-11 17:38:59 +01:00
parent b318ec1698
commit fa5e07f792

View File

@ -2083,6 +2083,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
pac.update(rev=pac.latest_rev())
@cmdln.option('-m', '--message', metavar='TEXT',
help='specify message TEXT')
def do_detachbranch(self, subcmd, opts, *args):
"""${cmd_name}: replace a link with its expanded sources
@ -2107,13 +2109,16 @@ Please submit there instead, or use --nodevelproject to force direct submission.
raise oscerr.WrongArgs('Too few arguments (required none or two)')
try:
copy_pac(apiurl, project, package, apiurl, project, package, expand=True)
copy_pac(apiurl, project, package, apiurl, project, package, expand=True, comment=opts.message)
except urllib2.HTTPError, e:
root = ET.fromstring(show_files_meta(apiurl, project, package, 'latest', expand=False))
li = Linkinfo()
li.read(root.find('linkinfo'))
if li.islink() and li.haserror():
raise oscerr.LinkExpandError(project, package, li.error)
elif not li.islink():
print >>sys.stderr, 'package \'%s/%s\' is no link' % (project, package)
else:
raise e