From b2adcb7d94d72249435febc56b758142525ca232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 4 Mar 2011 15:50:06 +0100 Subject: [PATCH] - do not crash on maintenance release or incident requests --- osc/commandline.py | 4 ++-- osc/core.py | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/osc/commandline.py b/osc/commandline.py index 1de7bcd5..76b2be30 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -432,7 +432,7 @@ class Osc(cmdln.Cmdln): if opts.force or not patchinfo: print "Creating initial patchinfo..." - query='cmd=createpatchinfo' + query='cmd=createpatchinfo&new_format=1' if args and args[0]: query += "&name=" + args[0] url = makeurl(apiurl, ['source', project], query=query) @@ -812,7 +812,7 @@ class Osc(cmdln.Cmdln): targetprojects = [] # loop via all packages for checking their state for p in meta_get_packagelist(apiurl, project): - if p.startswith("_patchinfo:"): + if p.startswith("_patchinfo:") or p.startswith("patchinfo"): pi.append(p) else: # get _link info from server, that knows about the local state ... diff --git a/osc/core.py b/osc/core.py index 7c20618c..7b131cdc 100644 --- a/osc/core.py +++ b/osc/core.py @@ -2283,7 +2283,9 @@ class Action: 'acceptinfo_rev', 'acceptinfo_srcmd5', 'acceptinfo_xsrcmd5', 'acceptinfo_osrcmd5', 'acceptinfo_oxsrcmd5', 'opt_updatelink'), 'add_role': ('tgt_project', 'tgt_package', 'person_name', 'person_role', 'group_name', 'group_role'), - 'set_bugowner': ('tgt_project', 'tgt_package', 'person_name'), + 'set_bugowner': ('tgt_project', 'tgt_package', 'person_name'), # obsoleted by add_role + 'maintenance_release': ('src_project', 'src_package', 'src_rev', 'tgt_project', 'tgt_package', 'person_name'), + 'maintenance_incident': ('src_project', 'tgt_project', 'person_name'), 'delete': ('tgt_project', 'tgt_package'), 'change_devel': ('src_project', 'src_package', 'tgt_project', 'tgt_package')} # attribute prefix to element name map (only needed for abbreviated attributes) @@ -2484,6 +2486,12 @@ class Request: elif action.type == 'change_devel': d['source'] = prj_pkg_join(action.tgt_project, action.tgt_package) d['target'] = 'developed in %s' % prj_pkg_join(action.src_project, action.src_package) + elif action.type == 'maintenance_incident': + d['source'] = '%s ->' % action.src_project + d['target'] = action.tgt_project + elif action.type == 'maintenance_release': + d['source'] = '%s ->' % prj_pkg_join(action.src_project, action.src_package) + d['target'] = prj_pkg_join(action.tgt_project, action.tgt_package) elif action.type == 'submit': srcupdate = ' ' if action.opt_sourceupdate and show_srcupdate: