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

- fixed misleading note (#644550 ("osc don't branch particular project"))

This commit is contained in:
Marcus Huewe 2011-02-08 16:56:16 +01:00
parent 55f580f988
commit 09cee2a9f0
2 changed files with 24 additions and 18 deletions

View File

@ -2419,11 +2419,16 @@ Please submit there instead, or use --nodevelproject to force direct submission.
print >>sys.stderr, 'Using existing branch project: %s' % targetprj
devloc = None
if not exists and (srcprj is not None and srcprj != args[0] or \
srcprj is None and targetprj != expected):
devloc = srcprj or targetprj
if not srcprj and 'branches:' in targetprj:
devloc = targetprj.split('branches:')[1]
if not exists and (srcprj != args[0] or srcpkg != args[1]):
try:
root = ET.fromstring(''.join(show_attribute_meta(apiurl, args[0], None, None,
conf.config['maintained_update_project_attribute'], False, False)))
# this might raise an AttributeError
uproject = root.find('attribute').find('value').text
print '\nNote: The branch has been created from the configured update project: %s' \
% uproject
except (AttributeError, urllib2.HTTPError), e:
devloc = srcprj
print '\nNote: The branch has been created of a different project,\n' \
' %s,\n' \
' which is the primary location of where development for\n' \
@ -2447,7 +2452,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
% (apiopt, targetprj, package)
print_request_list(apiurl, args[0], args[1])
if devloc:
print_request_list(apiurl, devloc, args[1])
print_request_list(apiurl, devloc, srcpkg)
def do_undelete(self, subcmd, opts, *args):

View File

@ -4332,12 +4332,13 @@ def branch_pkg(apiurl, src_project, src_package, nodevelproject=False, rev=None,
except urllib2.HTTPError, e:
if not return_existing:
raise
msg = ''.join(e.readlines())
msg = msg.split('<summary>')[1]
msg = msg.split('</summary>')[0]
m = re.match(r"branch target package already exists: (\S+)/(\S+)", msg)
root = ET.fromstring(e.read())
summary = root.find('summary')
if summary is None:
raise oscerr.APIError('unexpected response:\n%s' % ET.tostring(root))
m = re.match(r"branch target package already exists: (\S+)/(\S+)", summary.text)
if not m:
e.msg += '\n' + msg
e.msg += '\n' + summary.text
raise
return (True, m.group(1), m.group(2), None, None)