##// 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 mf1 = other._manifestmatches(match, s)
135 mf1 = other._manifestmatches(match, s)
136 mf2 = self._manifestmatches(match, s)
136 mf2 = self._manifestmatches(match, s)
137
137
138 modified, added, clean = [], [], []
138 modified, added = [], []
139 removed = []
140 clean = set()
139 deleted, unknown, ignored = s.deleted, s.unknown, s.ignored
141 deleted, unknown, ignored = s.deleted, s.unknown, s.ignored
140 deletedset = set(deleted)
142 deletedset = set(deleted)
141 withflags = mf1.withflags() | mf2.withflags()
143 d = mf1.diff(mf2)
142 for fn, mf2node in mf2.iteritems():
144 for fn, ((node1, flag1), (node2, flag2)) in d.iteritems():
143 if fn in deletedset:
145 if fn in deletedset:
144 continue
146 continue
145 if fn in mf1:
147 if node1 is None:
146 if ((fn in withflags and mf1.flags(fn) != mf2.flags(fn)) or
148 added.append(fn)
147 (mf1[fn] != mf2node and
149 elif node2 is None:
148 (mf2node != _newnode or self[fn].cmp(other[fn])))):
150 removed.append(fn)
149 modified.append(fn)
151 elif node2 != _newnode:
150 elif listclean:
152 # The file was not a new file in mf2, so an entry
151 clean.append(fn)
153 # from diff is really a difference.
152 del mf1[fn]
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 else:
159 else:
154 added.append(fn)
160 clean.add(fn)
155 removed = mf1.keys()
161 if listclean:
162 nondiff = (set(mf1) | set(mf2)) - set(d)
163 clean = list((clean | nondiff) - deletedset)
164 else:
165 clean = []
166
156 if removed:
167 if removed:
157 # need to filter files if they are already reported as removed
168 # need to filter files if they are already reported as removed
158 unknown = [fn for fn in unknown if fn not in mf1]
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