Mercurial > hg
comparison mercurial/bundlerepo.py @ 24882: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 |
parents | 6e31e1274080 |
children | 86c0b5c09ee6 |
comparison
equal
deleted
inserted
replaced
24881:51844b8b5017 | 24882:995003a324da |
---|---|
155 | 155 |
156 def baserevision(self, nodeorrev): | 156 def baserevision(self, nodeorrev): |
157 # Although changelog doesn't override 'revision' method, some extensions | 157 # Although changelog doesn't override 'revision' method, some extensions |
158 # may replace this class with another that does. Same story with | 158 # may replace this class with another that does. Same story with |
159 # manifest and filelog classes. | 159 # manifest and filelog classes. |
160 return changelog.changelog.revision(self, nodeorrev) | 160 |
161 # This bypasses filtering on changelog.node() and rev() because we need | |
162 # revision text of the bundle base even if it is hidden. | |
163 oldfilter = self.filteredrevs | |
164 try: | |
165 self.filteredrevs = () | |
166 return changelog.changelog.revision(self, nodeorrev) | |
167 finally: | |
168 self.filteredrevs = oldfilter | |
161 | 169 |
162 class bundlemanifest(bundlerevlog, manifest.manifest): | 170 class bundlemanifest(bundlerevlog, manifest.manifest): |
163 def __init__(self, opener, bundle, linkmapper): | 171 def __init__(self, opener, bundle, linkmapper): |
164 manifest.manifest.__init__(self, opener) | 172 manifest.manifest.__init__(self, opener) |
165 bundlerevlog.__init__(self, opener, self.indexfile, bundle, | 173 bundlerevlog.__init__(self, opener, self.indexfile, bundle, |