Mercurial > evolve
comparison hgext/obsolete.py @ 215:0eceb5a48485
obsolete: fix changelog reload
This changelog was not properly reloaded. This leaded to bug with rollback and
strip.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Wed, 25 Apr 2012 18:11:52 +0200 |
parents | a140d1857931 |
children | 786eb34d93ea |
comparison
equal
deleted
inserted
replaced
214:a140d1857931 | 215:0eceb5a48485 |
---|---|
618 self.__dict__.pop('_obsobjrels', None) | 618 self.__dict__.pop('_obsobjrels', None) |
619 return ret | 619 return ret |
620 | 620 |
621 @storecache('00changelog.i') | 621 @storecache('00changelog.i') |
622 def changelog(self): | 622 def changelog(self): |
623 changelog = getattr(super(obsoletingrepo, self), 'changelog') | 623 # << copy pasted from mercurila source |
624 old = changelog.__dict__.pop('hiddenrevs', ()) | 624 c = changelog.changelog(self.sopener) |
625 if 'HG_PENDING' in os.environ: | |
626 p = os.environ['HG_PENDING'] | |
627 if p.startswith(self.root): | |
628 c.readpending('00changelog.i.a') | |
629 # >> end of the copy paste | |
630 old = c.__dict__.pop('hiddenrevs', ()) | |
625 if old: | 631 if old: |
626 ui.warn("old wasn't empty ? %r" % old) | 632 ui.warn("old wasn't empty ? %r" % old) |
627 def _sethidden(changelog, value): | 633 def _sethidden(c, value): |
628 assert not value | 634 assert not value |
629 | 635 |
630 | 636 |
631 class hchangelog(changelog.__class__): | 637 class hchangelog(c.__class__): |
632 @util.propertycache | 638 @util.propertycache |
633 def hiddenrevs(changelog): | 639 def hiddenrevs(c): |
634 shown = ['not obsolete()', '.', 'bookmark()', 'tagged()', | 640 shown = ['not obsolete()', '.', 'bookmark()', 'tagged()', |
635 'public()'] | 641 'public()'] |
636 basicquery = 'obsolete() - (::(%s))' % (' or '.join(shown)) | 642 basicquery = 'obsolete() - (::(%s))' % (' or '.join(shown)) |
637 # !!! self is repo not changelog | 643 # !!! self is repo not changelog |
638 result = set(scmutil.revrange(self, [basicquery])) | 644 result = set(scmutil.revrange(self, [basicquery])) |
639 return result | 645 return result |
640 changelog.__class__ = hchangelog | 646 c.__class__ = hchangelog |
641 return changelog | 647 return c |
642 | 648 |
643 | 649 |
644 | 650 |
645 | 651 |
646 repo.__class__ = obsoletingrepo | 652 repo.__class__ = obsoletingrepo |