##// END OF EJS Templates
localrepo: do not cache auditor/nofsauditor which would make reference cycle...
Yuya Nishihara -
r39348:9198e41d default
parent child Browse files
Show More
@@ -436,14 +436,6 b' class localrepository(object):'
436 self.root = self.wvfs.base
436 self.root = self.wvfs.base
437 self.path = self.wvfs.join(".hg")
437 self.path = self.wvfs.join(".hg")
438 self.origroot = path
438 self.origroot = path
439 # This is only used by context.workingctx.match in order to
440 # detect files in subrepos.
441 self.auditor = pathutil.pathauditor(
442 self.root, callback=self._checknested)
443 # This is only used by context.basectx.match in order to detect
444 # files in subrepos.
445 self.nofsauditor = pathutil.pathauditor(
446 self.root, callback=self._checknested, realfs=False, cached=True)
447 self.baseui = baseui
439 self.baseui = baseui
448 self.ui = baseui.copy()
440 self.ui = baseui.copy()
449 self.ui.copy = baseui.copy # prevent copying repo configuration
441 self.ui.copy = baseui.copy # prevent copying repo configuration
@@ -709,6 +701,22 b' class localrepository(object):'
709 def _writerequirements(self):
701 def _writerequirements(self):
710 scmutil.writerequires(self.vfs, self.requirements)
702 scmutil.writerequires(self.vfs, self.requirements)
711
703
704 # Don't cache auditor/nofsauditor, or you'll end up with reference cycle:
705 # self -> auditor -> self._checknested -> self
706
707 @property
708 def auditor(self):
709 # This is only used by context.workingctx.match in order to
710 # detect files in subrepos.
711 return pathutil.pathauditor(self.root, callback=self._checknested)
712
713 @property
714 def nofsauditor(self):
715 # This is only used by context.basectx.match in order to detect
716 # files in subrepos.
717 return pathutil.pathauditor(self.root, callback=self._checknested,
718 realfs=False, cached=True)
719
712 def _checknested(self, path):
720 def _checknested(self, path):
713 """Determine if path is a legal nested repository."""
721 """Determine if path is a legal nested repository."""
714 if not path.startswith(self.root):
722 if not path.startswith(self.root):
General Comments 0
You need to be logged in to leave comments. Login now