##// END OF EJS Templates
revert: inline a now useless closure...
Pierre-Yves David -
r22212:f18aca03 default
parent child Browse files
Show More
@@ -2484,7 +2484,16 b' def revert(ui, repo, ctx, parents, *pats'
2484 for abs, (rel, exact) in sorted(names.items()):
2484 for abs, (rel, exact) in sorted(names.items()):
2485 # target file to be touch on disk (relative to cwd)
2485 # target file to be touch on disk (relative to cwd)
2486 target = repo.wjoin(abs)
2486 target = repo.wjoin(abs)
2487 def handle(xlist, dobackup):
2487 # search the entry in the dispatch table.
2488 # if the file is in any of these sets, it was touched in the working
2489 # directory parent and we are sure it needs to be reverted.
2490 for table, (xlist, dobackup) in disptable:
2491 if abs not in table:
2492 continue
2493 if xlist is None:
2494 if exact:
2495 ui.warn(_('no changes needed to %s\n') % rel)
2496 break
2488 xlist[0].append(abs)
2497 xlist[0].append(abs)
2489 if (dobackup and not opts.get('no_backup') and
2498 if (dobackup and not opts.get('no_backup') and
2490 os.path.lexists(target) and
2499 os.path.lexists(target) and
@@ -2499,18 +2508,6 b' def revert(ui, repo, ctx, parents, *pats'
2499 if not isinstance(msg, basestring):
2508 if not isinstance(msg, basestring):
2500 msg = msg(abs)
2509 msg = msg(abs)
2501 ui.status(msg % rel)
2510 ui.status(msg % rel)
2502 # search the entry in the dispatch table.
2503 # if the file is in any of this sets, it was touched in the working
2504 # directory parent and we are sure it needs to be reverted.
2505 for table, (action, backup) in disptable:
2506 if abs not in table:
2507 continue
2508 if action is None:
2509 if exact:
2510 ui.warn(_('no changes needed to %s\n') % rel)
2511
2512 else:
2513 handle(action, backup)
2514 break
2511 break
2515 else:
2512 else:
2516 # Not touched in current dirstate.
2513 # Not touched in current dirstate.
General Comments 0
You need to be logged in to leave comments. Login now