##// END OF EJS Templates
revert: simplify loop conditional...
Pierre-Yves David -
r22233:4ab61b24 default
parent child Browse files
Show More
@@ -2500,22 +2500,21 b' def revert(ui, repo, ctx, parents, *pats'
2500 for table, (xlist, msg), dobackup in disptable:
2500 for table, (xlist, msg), dobackup in disptable:
2501 if abs not in table:
2501 if abs not in table:
2502 continue
2502 continue
2503 if xlist is None:
2503 if xlist is not None:
2504 if exact:
2504 xlist.append(abs)
2505 ui.warn(_('no changes needed to %s\n') % rel)
2505 if (dobackup and os.path.lexists(target) and
2506 break
2506 abs in ctx and repo[None][abs].cmp(ctx[abs])):
2507 xlist.append(abs)
2507 bakname = "%s.orig" % rel
2508 if (dobackup and os.path.lexists(target) and
2508 ui.note(_('saving current version of %s as %s\n') %
2509 abs in ctx and repo[None][abs].cmp(ctx[abs])):
2509 (rel, bakname))
2510 bakname = "%s.orig" % rel
2510 if not opts.get('dry_run'):
2511 ui.note(_('saving current version of %s as %s\n') %
2511 util.rename(target, bakname)
2512 (rel, bakname))
2512 if ui.verbose or not exact:
2513 if not opts.get('dry_run'):
2513 if not isinstance(msg, basestring):
2514 util.rename(target, bakname)
2514 msg = msg(abs)
2515 if ui.verbose or not exact:
2515 ui.status(msg % rel)
2516 if not isinstance(msg, basestring):
2516 elif exact:
2517 msg = msg(abs)
2517 ui.warn(_('no changes needed to %s\n') % rel)
2518 ui.status(msg % rel)
2519 break
2518 break
2520 else:
2519 else:
2521 # Not touched in current dirstate.
2520 # Not touched in current dirstate.
General Comments 0
You need to be logged in to leave comments. Login now