comparison mercurial/localrepo.py @ 21469:65cdc6bab91e

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.
author Sean Farley <sean.michael.farley@gmail.com>
date Mon, 21 Apr 2014 20:23:47 -0500
parents 6c90a18dd926
children 1af854808a3c
comparison
equal deleted inserted replaced
21468:870ddcf24291 21469:65cdc6bab91e
1568 for f in removed: 1568 for f in removed:
1569 if f in mf2: 1569 if f in mf2:
1570 del mf2[f] 1570 del mf2[f]
1571 else: 1571 else:
1572 # we are comparing two revisions 1572 # we are comparing two revisions
1573 deleted, unknown, ignored = [], [], []
1574 mf2 = ctx2._manifestmatches(match, r) 1573 mf2 = ctx2._manifestmatches(match, r)
1575 1574
1576 modified, added, clean = [], [], [] 1575 modified, added, clean = [], [], []
1576 deleted, unknown, ignored = r[3], [], []
1577 withflags = mf1.withflags() | mf2.withflags() 1577 withflags = mf1.withflags() | mf2.withflags()
1578 for fn, mf2node in mf2.iteritems(): 1578 for fn, mf2node in mf2.iteritems():
1579 if fn in mf1: 1579 if fn in mf1:
1580 if (fn not in deleted and 1580 if (fn not in deleted and
1581 ((fn in withflags and mf1.flags(fn) != mf2.flags(fn)) or 1581 ((fn in withflags and mf1.flags(fn) != mf2.flags(fn)) or