Mercurial > evolve
comparison hgext/obsolete.py @ 386:a3797de26544
obsolete: rely on core to hide extinct changeset
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Wed, 25 Jul 2012 19:26:01 +0200 |
parents | cdcdedc532b7 |
children | 0e87a890d84b |
comparison
equal
deleted
inserted
replaced
385:cdcdedc532b7 | 386:a3797de26544 |
---|---|
855 os.unlink(dst) | 855 os.unlink(dst) |
856 # invalidate cache | 856 # invalidate cache |
857 self.__dict__.pop('obsstore', None) | 857 self.__dict__.pop('obsstore', None) |
858 return ret | 858 return ret |
859 | 859 |
860 @storecache('00changelog.i') | |
861 def changelog(self): | |
862 # << copy pasted from mercurial source | |
863 c = changelog.changelog(self.sopener) | |
864 if 'HG_PENDING' in os.environ: | |
865 p = os.environ['HG_PENDING'] | |
866 if p.startswith(self.root): | |
867 c.readpending('00changelog.i.a') | |
868 # >> end of the copy paste | |
869 old = c.__dict__.pop('hiddenrevs', ()) | |
870 if old: | |
871 ui.warn("old wasn't empty ? %r" % old) | |
872 def _sethidden(c, value): | |
873 assert not value | |
874 | |
875 | |
876 class hchangelog(c.__class__): | |
877 @util.propertycache | |
878 def hiddenrevs(c): | |
879 shown = ['not obsolete()', '.', 'bookmark()', 'tagged()', | |
880 'public()'] | |
881 basicquery = 'obsolete() - (::(%s))' % (' or '.join(shown)) | |
882 # !!! self is repo not changelog | |
883 result = set(scmutil.revrange(self, [basicquery])) | |
884 return result | |
885 c.__class__ = hchangelog | |
886 return c | |
887 | |
888 repo.__class__ = obsoletingrepo | 860 repo.__class__ = obsoletingrepo |
889 for arg in sys.argv: | 861 for arg in sys.argv: |
890 if 'debugc' in arg: | 862 if 'debugc' in arg: |
891 break | 863 break |
892 else: | 864 else: |