diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -131,12 +131,6 @@ class localrepository(object): # Callback are in the form: func(repo, roots) --> processed root. # This list it to be filled by extension during repo setup self._phasedefaults = [] - # hiddenrevs: revs that should be hidden by command and tools - # - # This set is carried on the repo to ease initialisation and lazy - # loading it'll probably move back to changelog for efficienty and - # consistency reason - self.hiddenrevs = set() try: self.ui.readconfig(self.join("hgrc"), self.root) extensions.loadall(self.ui) @@ -297,6 +291,25 @@ class localrepository(object): store = obsolete.obsstore(self.sopener) return store + @propertycache + def hiddenrevs(self): + """hiddenrevs: revs that should be hidden by command and tools + + This set is carried on the repo to ease initialisation and lazy + loading it'll probably move back to changelog for efficienty and + consistency reason + + Note that the hiddenrevs will needs invalidations when + - a new changesets is added (possible unstable above extinct) + - a new obsolete marker is added (possible new extinct changeset) + """ + hidden = set() + if self.obsstore: + ### hide extinct changeset that are not accessible by any mean + hiddenquery = 'extinct() - ::(. + bookmark() + tagged())' + hidden.update(self.revs(hiddenquery)) + return hidden + @storecache('00changelog.i') def changelog(self): c = changelog.changelog(self.sopener) diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -76,23 +76,6 @@ Check that graphlog detect that a change | date: Thu Jan 01 00:00:00 1970 +0000 | summary: add new_3_c | - | x changeset: 4:ca819180edb9 - |/ parent: 1:7c3bad9141dc - | user: test - | date: Thu Jan 01 00:00:00 1970 +0000 - | summary: add new_2_c - | - | x changeset: 3:cdbce2fbb163 - |/ parent: 1:7c3bad9141dc - | user: test - | date: Thu Jan 01 00:00:00 1970 +0000 - | summary: add new_c - | - | x changeset: 2:245bde4270cd - |/ user: test - | date: Thu Jan 01 00:00:00 1970 +0000 - | summary: add original_c - | o changeset: 1:7c3bad9141dc | user: test | date: Thu Jan 01 00:00:00 1970 +0000 @@ -115,18 +98,6 @@ Check that public changeset are not acco | date: Thu Jan 01 00:00:00 1970 +0000 | summary: add new_3_c | - | x changeset: 4:ca819180edb9 - |/ parent: 1:7c3bad9141dc - | user: test - | date: Thu Jan 01 00:00:00 1970 +0000 - | summary: add new_2_c - | - | x changeset: 3:cdbce2fbb163 - |/ parent: 1:7c3bad9141dc - | user: test - | date: Thu Jan 01 00:00:00 1970 +0000 - | summary: add new_c - | | o changeset: 2:245bde4270cd |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000