# HG changeset patch # User Pierre-Yves David # Date 2014-08-02 19:45:34 # Node ID 10d9e7908a3cebfe325b7545c48c46a8706247c6 # Parent 316ba2ddc034f509f6d3fd072889ad55ee4149bc revert: use actions[...] in all disptable cases 1. Special cases are not special enough 2. There are two cases where nothing is done and a message is displayed. This prepares it. diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -2469,7 +2469,9 @@ def revert(ui, repo, ctx, parents, *pats actions = {'revert': ([], _('reverting %s\n')), 'add': ([], _('adding %s\n')), 'remove': ([], removeforget), - 'undelete': ([], _('undeleting %s\n'))} + 'undelete': ([], _('undeleting %s\n')), + 'noop': None, + } # should we do a backup? @@ -2486,7 +2488,7 @@ def revert(ui, repo, ctx, parents, *pats (dsadded, actions['remove'], backup), (removed, actions['add'], backup), (dsremoved, actions['undelete'], backup), - (clean, None, discard), + (clean, actions['noop'], discard), ) for abs, (rel, exact) in sorted(names.items()):