[PATCH 1 of 2] bundlerepo: properly handle hidden linkrev in manifestlog (issue4945)

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Feb 22 23:31:27 UTC 2016


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1456180494 -3600
#      Mon Feb 22 23:34:54 2016 +0100
# Node ID 0f3c3d414e599f9445f0b86901c7ffefeabdcacb
# Parent  d3da97e58d42fa9427d55005f9a2941ec4bd9a4c
# Available At http://hg.netv6.net/marmoute-wip/mercurial/
#              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r 0f3c3d414e59
bundlerepo: properly handle hidden linkrev in manifestlog (issue4945)

The bundlerepository have to do some special magic to handle linkrev of the
bundled manifest. That logic was done from a repoview and obsolescence marker
affecting bundled changeset could lead to a crash. We now ensure we operate on
unfiltered repository.

diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -323,11 +323,12 @@ class bundlerepository(localrepo.localre
     @localrepo.unfilteredpropertycache
     def manifest(self):
         self.bundle.seek(self.manstart)
         # consume the header if it exists
         self.bundle.manifestheader()
-        m = bundlemanifest(self.svfs, self.bundle, self.changelog.rev)
+        linkmapper = self.unfiltered().changelog.rev
+        m = bundlemanifest(self.svfs, self.bundle, linkmapper)
         # XXX: hack to work with changegroup3, but we still don't handle
         # tree manifests correctly
         if self.bundle.version == "03":
             self.bundle.filelogheader()
         self.filestart = self.bundle.tell()


More information about the Mercurial-devel mailing list