From 2d1126b8471e172b5215b348b3891002a9cefc30 Mon Sep 17 00:00:00 2001 From: Michal Vyskocil Date: Fri, 31 Jul 2009 11:32:34 +0000 Subject: [PATCH] osc commit asks if some file has a '?' status --- NEWS | 1 + osc/commandline.py | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/NEWS b/NEWS index 2107b841..544cd6d1 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ - fix and improve request list and show output - new osc rremove command for remote source files removal - handle _service\* files correctly + - osc commit asks if some file has a '?' status 0.120: - support "setlinkrev" for whole projects diff --git a/osc/commandline.py b/osc/commandline.py index 3db0ec7b..33b818b8 100755 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -1641,6 +1641,18 @@ Please submit there instead, or use --nodevelproject to force direct submission. pacs = findpacs(args) + # warn if any of files has a ? status (usually a patch, or new source was not added to meta) + for p in pacs: + # no files given as argument? Take all files in current dir + if not p.todo: + p.todo = p.filenamelist + p.filenamelist_unvers + p.todo.sort() + for f in (f for f in p.todo if os.path.isfile(f)): + if p.status(f) == '?': + resp = raw_input("File `%s' is not in package meta. Would you like to continue? [y/N] "% (f, )) + if resp not in ('y', 'Y'): + return + if not msg: # open editor for commit message # but first, produce status and diff to append to the template