mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-10 06:46:15 +01:00
fix addremove/remove for already deleted files
This commit is contained in:
parent
ab258100ca
commit
9fbbd4f1ce
15
osc.py
15
osc.py
@ -276,16 +276,17 @@ def main():
|
||||
|
||||
for arg in args:
|
||||
|
||||
if os.path.isfile(arg):
|
||||
wd = os.path.dirname(arg)
|
||||
if not wd: wd = os.curdir
|
||||
filenames = [ os.path.basename(arg) ]
|
||||
olddir = os.getcwd()
|
||||
|
||||
wd = os.path.dirname(arg) or os.curdir
|
||||
filename = arg
|
||||
|
||||
os.chdir(wd)
|
||||
|
||||
for filename in filenames:
|
||||
localmeta_removefile(filename)
|
||||
print 'D %s' % filename
|
||||
localmeta_removefile(filename)
|
||||
print 'D %s' % filename
|
||||
|
||||
os.chdir(olddir)
|
||||
|
||||
|
||||
elif cmd == 'id':
|
||||
|
10
osclib.py
10
osclib.py
@ -222,7 +222,7 @@ def get_file_status(prj, package, filename, filelist=None):
|
||||
x - - '?'
|
||||
x - x 'A'
|
||||
- x x '!'
|
||||
- x - NOT DEFINED
|
||||
- x - 'D' (when file in working copy is already deleted)
|
||||
- - x NOT DEFINED
|
||||
- - - NEVER REACHED
|
||||
|
||||
@ -257,15 +257,13 @@ def get_file_status(prj, package, filename, filelist=None):
|
||||
elif not exists and exists_in_store and known_by_meta:
|
||||
state = '!'
|
||||
elif not exists and not exists_in_store and known_by_meta:
|
||||
print 'not exists and not exists_in_store and known_by_meta'
|
||||
print '%s: not exists and not exists_in_store and known_by_meta' % filename
|
||||
print 'this state is undefined!'
|
||||
sys.exit(1)
|
||||
elif not exists and exists_in_store and not known_by_meta:
|
||||
print 'not exists and exists_in_store and not nown_by_meta'
|
||||
print 'this state is undefined!'
|
||||
sys.exit(1)
|
||||
state = 'D'
|
||||
elif not exists and not exists_in_store and not known_by_meta:
|
||||
print 'not exists and not exists_in_store and not nown_by_meta'
|
||||
print '%s: not exists and not exists_in_store and not nown_by_meta' % filename
|
||||
print 'this code path should never be reached!'
|
||||
sys.exit(1)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user