Mercurial > hg > mercurial-source
diff mercurial/bundlerepo.py @ 25139:995003a324da stable
bundlerepo: disable filtering of changelog while constructing revision text
This avoids the following error that happened if base revision of bundle file
was hidden. bundlerevlog needs it to construct revision texts from bundle
content as revlog.revision() does.
File "mercurial/context.py", line 485, in _changeset
return self._repo.changelog.read(self.rev())
File "mercurial/changelog.py", line 319, in read
text = self.revision(node)
File "mercurial/bundlerepo.py", line 124, in revision
text = self.baserevision(iterrev)
File "mercurial/bundlerepo.py", line 160, in baserevision
return changelog.changelog.revision(self, nodeorrev)
File "mercurial/revlog.py", line 1041, in revision
node = self.node(rev)
File "mercurial/changelog.py", line 211, in node
raise error.FilteredIndexError(rev)
mercurial.error.FilteredIndexError: 1
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 29 Apr 2015 19:47:37 +0900 (2015-04-29) |
parents | 6e31e1274080 |
children | 86c0b5c09ee6 |
line wrap: on
line diff
--- a/mercurial/bundlerepo.py +++ b/mercurial/bundlerepo.py @@ -157,7 +157,15 @@ # Although changelog doesn't override 'revision' method, some extensions # may replace this class with another that does. Same story with # manifest and filelog classes. - return changelog.changelog.revision(self, nodeorrev) + + # This bypasses filtering on changelog.node() and rev() because we need + # revision text of the bundle base even if it is hidden. + oldfilter = self.filteredrevs + try: + self.filteredrevs = () + return changelog.changelog.revision(self, nodeorrev) + finally: + self.filteredrevs = oldfilter class bundlemanifest(bundlerevlog, manifest.manifest): def __init__(self, opener, bundle, linkmapper):