# HG changeset patch # User Pierre-Yves David # Date 1403627983 -3600 # Node ID f18aca03ddd9daac1ae3a97400cdbb5a07390d7a # Parent 76fa261b5fe30fbddaf11167b2cbe084fc130de0 revert: inline a now useless closure Now that a single call site remains, we can just inline its content. diff -r 76fa261b5fe3 -r f18aca03ddd9 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Tue Jun 24 17:37:24 2014 +0100 +++ b/mercurial/cmdutil.py Tue Jun 24 17:39:43 2014 +0100 @@ -2484,7 +2484,16 @@ for abs, (rel, exact) in sorted(names.items()): # target file to be touch on disk (relative to cwd) target = repo.wjoin(abs) - def handle(xlist, dobackup): + # search the entry in the dispatch table. + # if the file is in any of these sets, it was touched in the working + # directory parent and we are sure it needs to be reverted. + for table, (xlist, dobackup) in disptable: + if abs not in table: + continue + if xlist is None: + if exact: + ui.warn(_('no changes needed to %s\n') % rel) + break xlist[0].append(abs) if (dobackup and not opts.get('no_backup') and os.path.lexists(target) and @@ -2499,18 +2508,6 @@ if not isinstance(msg, basestring): msg = msg(abs) ui.status(msg % rel) - # search the entry in the dispatch table. - # if the file is in any of this sets, it was touched in the working - # directory parent and we are sure it needs to be reverted. - for table, (action, backup) in disptable: - if abs not in table: - continue - if action is None: - if exact: - ui.warn(_('no changes needed to %s\n') % rel) - - else: - handle(action, backup) break else: # Not touched in current dirstate.