##// END OF EJS Templates
context: use manifest.diff() to compute most of status...
Augie Fackler -
r23755:d43948a9 default
parent child Browse files
Show More
@@ -135,24 +135,35 b' class basectx(object):'
135 135 mf1 = other._manifestmatches(match, s)
136 136 mf2 = self._manifestmatches(match, s)
137 137
138 modified, added, clean = [], [], []
138 modified, added = [], []
139 removed = []
140 clean = set()
139 141 deleted, unknown, ignored = s.deleted, s.unknown, s.ignored
140 142 deletedset = set(deleted)
141 withflags = mf1.withflags() | mf2.withflags()
142 for fn, mf2node in mf2.iteritems():
143 d = mf1.diff(mf2)
144 for fn, ((node1, flag1), (node2, flag2)) in d.iteritems():
143 145 if fn in deletedset:
144 146 continue
145 if fn in mf1:
146 if ((fn in withflags and mf1.flags(fn) != mf2.flags(fn)) or
147 (mf1[fn] != mf2node and
148 (mf2node != _newnode or self[fn].cmp(other[fn])))):
149 modified.append(fn)
150 elif listclean:
151 clean.append(fn)
152 del mf1[fn]
147 if node1 is None:
148 added.append(fn)
149 elif node2 is None:
150 removed.append(fn)
151 elif node2 != _newnode:
152 # The file was not a new file in mf2, so an entry
153 # from diff is really a difference.
154 modified.append(fn)
155 elif self[fn].cmp(other[fn]):
156 # node2 was newnode, but the working file doesn't
157 # match the one in mf1.
158 modified.append(fn)
153 159 else:
154 added.append(fn)
155 removed = mf1.keys()
160 clean.add(fn)
161 if listclean:
162 nondiff = (set(mf1) | set(mf2)) - set(d)
163 clean = list((clean | nondiff) - deletedset)
164 else:
165 clean = []
166
156 167 if removed:
157 168 # need to filter files if they are already reported as removed
158 169 unknown = [fn for fn in unknown if fn not in mf1]
General Comments 0
You need to be logged in to leave comments. Login now