1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-27 07:06:13 +01:00

osc add now clears files from _to_be_deleted

This happens, if a file was previously deleted, and the user changes his
mind before a commit. Such an add is no longer an add, but a cancel for the
planned delete. This resulted in unexpected loss of the file, on the server, as
the message 'is already under version control' is quite misleading in this case.
This commit is contained in:
Juergen Weigert 2010-03-08 00:08:55 +01:00
parent 35bc256de0
commit 5a97588b85

View File

@ -4437,7 +4437,14 @@ def addFiles(filenames, prj_obj = None):
print >>sys.stderr, 'osc: warning: \'%s\' is excluded from a working copy' % filename
continue
if filename in pac.filenamelist:
print >>sys.stderr, 'osc: warning: \'%s\' is already under version control' % filename
# check if this is a re-add after delete.
pac.to_be_deleted = read_tobedeleted(pac.dir)
try:
pac.to_be_deleted.remove(filename)
print >>sys.stderr, 'osc: Note: \'%s\' was deleted, is now re-added' % filename
pac.write_deletelist()
except:
print >>sys.stderr, 'osc: Warning: \'%s\' is already under version control' % filename
continue
if pac.dir != '.':
pathname = os.path.join(pac.dir, filename)