localrepo: move the order of local variables
authorSean Farley <sean.michael.farley@gmail.com>
Mon, 21 Apr 2014 20:23:47 -0500
changeset 21469 65cdc6bab91e
parent 21468 870ddcf24291
child 21470 1af854808a3c
localrepo: move the order of local variables This movement is a small step in getting rid of the 'if ... else' logic for testing the current working directory with its parent. Previously, the deleted, unknown, and ignored variables were set in a combination of before an 'if ... else' block and within the block. This moves the variables to be set outside the loop in one common place.
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Tue Apr 15 15:43:30 2014 -0500
+++ b/mercurial/localrepo.py	Mon Apr 21 20:23:47 2014 -0500
@@ -1570,10 +1570,10 @@
                         del mf2[f]
             else:
                 # we are comparing two revisions
-                deleted, unknown, ignored = [], [], []
                 mf2 = ctx2._manifestmatches(match, r)
 
             modified, added, clean = [], [], []
+            deleted, unknown, ignored = r[3], [], []
             withflags = mf1.withflags() | mf2.withflags()
             for fn, mf2node in mf2.iteritems():
                 if fn in mf1: