Mercurial > hg-stable
changeset 22229:3a7b45a0bd20
revert: use a flat dispatch table
Now that the table is simpler, remove one level of depth from it. This
simplifies its usage in the for loop.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 24 Jun 2014 17:44:31 +0100 |
parents | a3dc2d385490 |
children | 316ba2ddc034 |
files | mercurial/cmdutil.py |
diffstat | 1 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Fri Aug 15 18:26:21 2014 -0700 +++ b/mercurial/cmdutil.py Tue Jun 24 17:44:31 2014 +0100 @@ -2476,12 +2476,12 @@ # file state # action # make backup - (modified, (actions['revert'], False)), - (dsmodified, (actions['revert'], True)), - (dsadded, (actions['remove'], True)), - (removed, (actions['add'], True)), - (dsremoved, (actions['undelete'], True)), - (clean, (None, False)), + (modified, actions['revert'], False), + (dsmodified, actions['revert'], True), + (dsadded, actions['remove'], True), + (removed, actions['add'], True), + (dsremoved, actions['undelete'], True), + (clean, None, False), ) for abs, (rel, exact) in sorted(names.items()): @@ -2490,7 +2490,7 @@ # 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: + for table, xlist, dobackup in disptable: if abs not in table: continue if xlist is None: