From 3820c19c9de9eb34b6730529bc125a9b7f8eb417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Wed, 15 Feb 2012 13:13:44 +0100 Subject: [PATCH] - fix cleanup handling of maintenance request --- osc/commandline.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osc/commandline.py b/osc/commandline.py index d7e0dd62..0f4fa617 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -2659,8 +2659,6 @@ Please submit there instead, or use --nodevelproject to force direct submission. maintenance_attribute = opts.attribute source_project = source_packages = target_project = opt_sourceupdate = None - if not opts.no_cleanup: - opt_sourceupdate = 'cleanup' if len(args) == 0 and is_project_dir(os.curdir): source_project = store_read_project(os.curdir) @@ -2670,6 +2668,10 @@ Please submit there instead, or use --nodevelproject to force direct submission. source_project = args[0] if len(args) > 1: source_packages = args[1:] + if not opts.no_cleanup: + default_branch = 'home:%s:branches:' % (conf.get_apiurl_usr(apiurl)) + if source_project.startswith(default_branch) and not opts.no_cleanup: + opt_sourceupdate = 'cleanup' if opts.incident_project: target_project = opts.incident_project