##// END OF EJS Templates
dirstate: remove _dirs property cache...
Durham Goode -
r34678:014bd2a5 default
parent child Browse files
Show More
@@ -519,7 +519,7 b' def perfdirs(ui, repo, **opts):'
519 519 'a' in dirstate
520 520 def d():
521 521 dirstate.dirs()
522 del dirstate._dirs
522 del dirstate._map.dirs
523 523 timer(d)
524 524 fm.end()
525 525
@@ -538,8 +538,8 b' def perfdirstatedirs(ui, repo, **opts):'
538 538 timer, fm = gettimer(ui, opts)
539 539 "a" in repo.dirstate
540 540 def d():
541 "a" in repo.dirstate._dirs
542 del repo.dirstate._dirs
541 "a" in repo.dirstate._map.dirs
542 del repo.dirstate._map.dirs
543 543 timer(d)
544 544 fm.end()
545 545
@@ -562,7 +562,7 b' def perfdirfoldmap(ui, repo, **opts):'
562 562 def d():
563 563 dirstate._dirfoldmap.get('a')
564 564 del dirstate._dirfoldmap
565 del dirstate._dirs
565 del dirstate._map.dirs
566 566 timer(d)
567 567 fm.end()
568 568
@@ -136,7 +136,7 b' class dirstate(object):'
136 136 def _dirfoldmap(self):
137 137 f = {}
138 138 normcase = util.normcase
139 for name in self._dirs:
139 for name in self._map.dirs:
140 140 f[normcase(name)] = name
141 141 return f
142 142
@@ -166,12 +166,8 b' class dirstate(object):'
166 166 def _pl(self):
167 167 return self._map.parents()
168 168
169 @propertycache
170 def _dirs(self):
171 return self._map.dirs()
172
173 169 def dirs(self):
174 return self._dirs
170 return self._map.dirs
175 171
176 172 @rootcache('.hgignore')
177 173 def _ignore(self):
@@ -377,7 +373,7 b' class dirstate(object):'
377 373 check whether the dirstate has changed before rereading it.'''
378 374
379 375 for a in ("_map", "_dirfoldmap", "_branch",
380 "_dirs", "_ignore"):
376 "_ignore"):
381 377 if a in self.__dict__:
382 378 delattr(self, a)
383 379 self._lastnormaltime = 0
@@ -405,8 +401,8 b' class dirstate(object):'
405 401 return self._map.copymap
406 402
407 403 def _droppath(self, f):
408 if self[f] not in "?r" and "_dirs" in self.__dict__:
409 self._dirs.delpath(f)
404 if self[f] not in "?r" and "dirs" in self._map.__dict__:
405 self._map.dirs.delpath(f)
410 406
411 407 if "filefoldmap" in self._map.__dict__:
412 408 normed = util.normcase(f)
@@ -419,18 +415,18 b' class dirstate(object):'
419 415 oldstate = self[f]
420 416 if state == 'a' or oldstate == 'r':
421 417 scmutil.checkfilename(f)
422 if f in self._dirs:
418 if f in self._map.dirs:
423 419 raise error.Abort(_('directory %r already in dirstate') % f)
424 420 # shadows
425 421 for d in util.finddirs(f):
426 if d in self._dirs:
422 if d in self._map.dirs:
427 423 break
428 424 entry = self._map.get(d)
429 425 if entry is not None and entry[0] != 'r':
430 426 raise error.Abort(
431 427 _('file %r in dirstate clashes with %r') % (d, f))
432 if oldstate in "?r" and "_dirs" in self.__dict__:
433 self._dirs.addpath(f)
428 if oldstate in "?r" and "dirs" in self._map.__dict__:
429 self._map.dirs.addpath(f)
434 430 self._dirty = True
435 431 self._updatedfiles.add(f)
436 432 self._map[f] = dirstatetuple(state, mode, size, mtime)
@@ -607,8 +603,6 b' class dirstate(object):'
607 603
608 604 def clear(self):
609 605 self._map = dirstatemap(self._ui, self._opener, self._root)
610 if "_dirs" in self.__dict__:
611 delattr(self, "_dirs")
612 606 self._map.setparents(nullid, nullid)
613 607 self._lastnormaltime = 0
614 608 self._updatedfiles.clear()
@@ -1287,6 +1281,7 b' class dirstatemap(object):'
1287 1281 f['.'] = '.' # prevents useless util.fspath() invocation
1288 1282 return f
1289 1283
1284 @propertycache
1290 1285 def dirs(self):
1291 1286 """Returns a set-like object containing all the directories in the
1292 1287 current dirstate.
General Comments 0
You need to be logged in to leave comments. Login now