revert: use actions[...] in all disptable cases
authorPierre-Yves David <pierre-yves.david@fb.com>
Sat, 02 Aug 2014 12:45:34 -0700
changeset 22231 10d9e7908a3c
parent 22230 316ba2ddc034
child 22232 91df98701e9e
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.
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Tue Jun 24 17:54:33 2014 +0100
+++ b/mercurial/cmdutil.py	Sat Aug 02 12:45:34 2014 -0700
@@ -2469,7 +2469,9 @@
         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 @@
             (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()):