From 101bcef08674fcab46612dfffa481df431c1b064 Mon Sep 17 00:00:00 2001 From: Michal Vyskocil Date: Mon, 3 Aug 2009 15:20:17 +0000 Subject: [PATCH] proper handling of removed files Removed files should be hanlded too, so the code will iterate through non-dirs, instead of files only. Plus the default action for '!' files is remove. --- osc/core.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/osc/core.py b/osc/core.py index 41b9365d..190aac1c 100755 --- a/osc/core.py +++ b/osc/core.py @@ -1252,8 +1252,12 @@ rev: %s self.todo.sort() ret = "" - for f in (f for f in self.todo if os.path.isfile(f)): - ret += "leave %s %s\n" % (self.status(f), f) + for f in (f for f in self.todo if not os.path.isdir(f)): + action = 'leave' + status = self.status(f) + if status == '!': + action = 'remove' + ret += "%s %s %s\n" % (action, status, f) ret += """ # Edit a filelist for package %s @@ -4107,8 +4111,8 @@ def check_filelist_before_commit(pacs): 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) == '?': + for f in (f for f in p.todo if not os.path.isdir(f)): + if p.status(f) in ('?', '!'): resp = raw_input("File `%s' is not in package meta. Would you like skip/remove/edit file lists/commit/abort? (s/r/e/c/A) "% (f, )) if resp in ('s', 'S'): continue