revert directories added by copying recursively

This commit is contained in:
Josh Holtrop 2014-10-08 11:52:40 -04:00
parent 127815dd1f
commit 030c1c519f

12
jsvn
View File

@ -1247,15 +1247,19 @@ def revert_h(argv, svn, out, config):
if action in ('A', 'M', 'C', 'D', '!') or prop_action == 'M': if action in ('A', 'M', 'C', 'D', '!') or prop_action == 'M':
fname = m.group(1) fname = m.group(1)
if action in ('D', '!'): if action in ('D', '!'):
modified_files.append(fname) modified_files.append((action, fname))
else: else:
modified_files.insert(0, fname) modified_files.insert(0, (action, fname))
for fname in modified_files: for action, fname in modified_files:
for target in argv: for target in argv:
if fname.startswith(os.getcwd() + os.sep): if fname.startswith(os.getcwd() + os.sep):
fname = fname[len(os.getcwd() + os.sep):] fname = fname[len(os.getcwd() + os.sep):]
if target == '.' or target == fname or fname.startswith(target + os.sep): if target == '.' or target == fname or fname.startswith(target + os.sep):
Popen([svn, 'revert', fname]).wait() cmd = [svn, "revert"]
if action == 'A':
cmd += ["--depth", "infinity"]
cmd.append(fname)
Popen(cmd).wait()
did_something = True did_something = True
break break
return RET_OK if did_something else RET_REEXEC return RET_OK if did_something else RET_REEXEC