1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-10 13:05:46 +01:00

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.
This commit is contained in:
Michal Vyskocil 2009-08-03 15:20:17 +00:00
parent 724f577b41
commit 101bcef086

View File

@ -1252,8 +1252,12 @@ rev: %s
self.todo.sort() self.todo.sort()
ret = "" ret = ""
for f in (f for f in self.todo if os.path.isfile(f)): for f in (f for f in self.todo if not os.path.isdir(f)):
ret += "leave %s %s\n" % (self.status(f), f) action = 'leave'
status = self.status(f)
if status == '!':
action = 'remove'
ret += "%s %s %s\n" % (action, status, f)
ret += """ ret += """
# Edit a filelist for package %s # Edit a filelist for package %s
@ -4107,8 +4111,8 @@ def check_filelist_before_commit(pacs):
if not p.todo: if not p.todo:
p.todo = p.filenamelist + p.filenamelist_unvers p.todo = p.filenamelist + p.filenamelist_unvers
p.todo.sort() p.todo.sort()
for f in (f for f in p.todo if os.path.isfile(f)): for f in (f for f in p.todo if not os.path.isdir(f)):
if p.status(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, )) 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'): if resp in ('s', 'S'):
continue continue