##// END OF EJS Templates
dirstate-map: factor out the change to _dirs and _alldirs on adding...
marmoute -
r48487:e59bd672 default
parent child Browse files
Show More
@@ -146,6 +146,15 b' class dirstatemap(object):'
146 146 """Loads the underlying data, if it's not already loaded"""
147 147 self._map
148 148
149 def _dirs_incr(self, filename, old_entry=None):
150 """incremente the dirstate counter if applicable"""
151 if (
152 old_entry is None or old_entry.removed
153 ) and "_dirs" in self.__dict__:
154 self._dirs.addpath(filename)
155 if old_entry is None and "_alldirs" in self.__dict__:
156 self._alldirs.addpath(filename)
157
149 158 def addfile(
150 159 self,
151 160 f,
@@ -190,12 +199,7 b' class dirstatemap(object):'
190 199 assert size is not None
191 200 assert mtime is not None
192 201 old_entry = self.get(f)
193 if (
194 old_entry is None or old_entry.removed
195 ) and "_dirs" in self.__dict__:
196 self._dirs.addpath(f)
197 if old_entry is None and "_alldirs" in self.__dict__:
198 self._alldirs.addpath(f)
202 self._dirs_incr(f, old_entry)
199 203 e = self._map[f] = DirstateItem(state, mode, size, mtime)
200 204 if e.dm_nonnormal:
201 205 self.nonnormalset.add(f)
General Comments 0
You need to be logged in to leave comments. Login now