mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-24 17:16:12 +01:00
- fixed misleading note (#644550 ("osc don't branch particular project"))
This commit is contained in:
parent
55f580f988
commit
09cee2a9f0
@ -2419,18 +2419,23 @@ 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]
|
||||
print '\nNote: The branch has been created of a different project,\n' \
|
||||
' %s,\n' \
|
||||
' which is the primary location of where development for\n' \
|
||||
' that package takes place.\n' \
|
||||
' That\'s also where you would normally make changes against.\n' \
|
||||
' A direct branch of the specified package can be forced\n' \
|
||||
' with the --nodevelproject option.\n' % devloc
|
||||
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' \
|
||||
' that package takes place.\n' \
|
||||
' That\'s also where you would normally make changes against.\n' \
|
||||
' A direct branch of the specified package can be forced\n' \
|
||||
' with the --nodevelproject option.\n' % devloc
|
||||
|
||||
package = tpackage or args[1]
|
||||
if opts.checkout:
|
||||
@ -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):
|
||||
|
11
osc/core.py
11
osc/core.py
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user