##// END OF EJS Templates
dirstate-map: factor out the change to _dirs and _alldirs on removing...
marmoute -
r48489:f2aef39a default
parent child Browse files
Show More
@@ -155,13 +155,15 b' class dirstatemap(object):'
155 if old_entry is None and "_alldirs" in self.__dict__:
155 if old_entry is None and "_alldirs" in self.__dict__:
156 self._alldirs.addpath(filename)
156 self._alldirs.addpath(filename)
157
157
158 def _dirs_decr(self, filename, old_entry=None):
158 def _dirs_decr(self, filename, old_entry=None, remove_variant=False):
159 """decremente the dirstate counter if applicable"""
159 """decremente the dirstate counter if applicable"""
160 if old_entry is not None:
160 if old_entry is not None:
161 if "_dirs" in self.__dict__ and not old_entry.removed:
161 if "_dirs" in self.__dict__ and not old_entry.removed:
162 self._dirs.delpath(filename)
162 self._dirs.delpath(filename)
163 if "_alldirs" in self.__dict__:
163 if "_alldirs" in self.__dict__ and not remove_variant:
164 self._alldirs.delpath(filename)
164 self._alldirs.delpath(filename)
165 elif remove_variant and "_alldirs" in self.__dict__:
166 self._alldirs.addpath(filename)
165 if "filefoldmap" in self.__dict__:
167 if "filefoldmap" in self.__dict__:
166 normed = util.normcase(filename)
168 normed = util.normcase(filename)
167 self.filefoldmap.pop(normed, None)
169 self.filefoldmap.pop(normed, None)
@@ -241,14 +243,7 b' class dirstatemap(object):'
241 self.otherparentset.add(f)
243 self.otherparentset.add(f)
242 if entry is not None and not (entry.merged or entry.from_p2):
244 if entry is not None and not (entry.merged or entry.from_p2):
243 self.copymap.pop(f, None)
245 self.copymap.pop(f, None)
244
246 self._dirs_decr(f, old_entry=entry, remove_variant=True)
245 if entry is not None and not entry.removed and "_dirs" in self.__dict__:
246 self._dirs.delpath(f)
247 if entry is None and "_alldirs" in self.__dict__:
248 self._alldirs.addpath(f)
249 if "filefoldmap" in self.__dict__:
250 normed = util.normcase(f)
251 self.filefoldmap.pop(normed, None)
252 self._map[f] = DirstateItem(b'r', 0, size, 0)
247 self._map[f] = DirstateItem(b'r', 0, size, 0)
253 self.nonnormalset.add(f)
248 self.nonnormalset.add(f)
254
249
General Comments 0
You need to be logged in to leave comments. Login now