comparison mercurial/localrepo.py @ 17208:8018f2340807

obsolete: mark unreachable extinct changesets as hidden The repo.hiddenrevs set is updated with all extinct() changesets which aren't descendants of either: - the current working copy, - a bookmark, - a tag.
author Pierre-Yves.David@ens-lyon.org
date Mon, 16 Jul 2012 17:56:50 +0200
parents 62c56c94c77e
children ec80ae982689
comparison
equal deleted inserted replaced
17207:62c56c94c77e 17208:8018f2340807
129 self.ui = baseui.copy() 129 self.ui = baseui.copy()
130 # A list of callback to shape the phase if no data were found. 130 # A list of callback to shape the phase if no data were found.
131 # Callback are in the form: func(repo, roots) --> processed root. 131 # Callback are in the form: func(repo, roots) --> processed root.
132 # This list it to be filled by extension during repo setup 132 # This list it to be filled by extension during repo setup
133 self._phasedefaults = [] 133 self._phasedefaults = []
134 # hiddenrevs: revs that should be hidden by command and tools
135 #
136 # This set is carried on the repo to ease initialisation and lazy
137 # loading it'll probably move back to changelog for efficienty and
138 # consistency reason
139 self.hiddenrevs = set()
140 try: 134 try:
141 self.ui.readconfig(self.join("hgrc"), self.root) 135 self.ui.readconfig(self.join("hgrc"), self.root)
142 extensions.loadall(self.ui) 136 extensions.loadall(self.ui)
143 except IOError: 137 except IOError:
144 pass 138 pass
294 288
295 @storecache('obsstore') 289 @storecache('obsstore')
296 def obsstore(self): 290 def obsstore(self):
297 store = obsolete.obsstore(self.sopener) 291 store = obsolete.obsstore(self.sopener)
298 return store 292 return store
293
294 @propertycache
295 def hiddenrevs(self):
296 """hiddenrevs: revs that should be hidden by command and tools
297
298 This set is carried on the repo to ease initialisation and lazy
299 loading it'll probably move back to changelog for efficienty and
300 consistency reason
301
302 Note that the hiddenrevs will needs invalidations when
303 - a new changesets is added (possible unstable above extinct)
304 - a new obsolete marker is added (possible new extinct changeset)
305 """
306 hidden = set()
307 if self.obsstore:
308 ### hide extinct changeset that are not accessible by any mean
309 hiddenquery = 'extinct() - ::(. + bookmark() + tagged())'
310 hidden.update(self.revs(hiddenquery))
311 return hidden
299 312
300 @storecache('00changelog.i') 313 @storecache('00changelog.i')
301 def changelog(self): 314 def changelog(self):
302 c = changelog.changelog(self.sopener) 315 c = changelog.changelog(self.sopener)
303 if 'HG_PENDING' in os.environ: 316 if 'HG_PENDING' in os.environ: