# HG changeset patch # User Pierre-Yves David # Date 1403628271 -3600 # Node ID 3a7b45a0bd20ffe7e24daecd322676af18706487 # Parent a3dc2d3854908c84b44736ba9a8f2a72c286404c 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. diff -r a3dc2d385490 -r 3a7b45a0bd20 mercurial/cmdutil.py --- 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: