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

login
register
mail settings
Submitter Pierre-Yves David
Date Feb. 22, 2016, 11:31 p.m.
Message ID <0f3c3d414e599f9445f0.1456183887@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/13301/
State Superseded
Headers show

Comments

Pierre-Yves David - Feb. 22, 2016, 11:31 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.

Patch

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()