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

login
register
mail settings
Submitter Pierre-Yves David
Date Feb. 23, 2016, 12:13 p.m.
Message ID <2aa1522e1018ff38639c.1456229605@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/13309/
State Accepted
Delegated to: Martin von Zweigbergk
Headers show

Comments

Pierre-Yves David - Feb. 23, 2016, 12:13 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
# Branch stable
# Node ID 2aa1522e1018ff38639c4e6841afbaa24fc6263c
# Parent  50c9e7028d6e84bd7566ff4db618631c7acaeacf
# Available At http://hg.netv6.net/marmoute-wip/mercurial/
#              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r 2aa1522e1018
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()