Patchwork [3,of,3,STABLE] unionrepo: properly handle hidden linkrev in revlog (issue5070)

login
register
mail settings
Submitter Pierre-Yves David
Date Feb. 23, 2016, 12:13 p.m.
Message ID <0f36e00ba083d644f7e5.1456229606@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/13310/
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 1456180564 -3600
#      Mon Feb 22 23:36:04 2016 +0100
# Branch stable
# Node ID 0f36e00ba083d644f7e57580fda49f0eb124536b
# Parent  2aa1522e1018ff38639c4e6841afbaa24fc6263c
# Available At http://hg.netv6.net/marmoute-wip/mercurial/
#              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r 0f36e00ba083
unionrepo: properly handle hidden linkrev in revlog (issue5070)

The unionrepository have to do some special magic to handle linkrev of the
unioned filerev and manifestrev. 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.
Martin von Zweigbergk - Feb. 24, 2016, 10:49 p.m.
queued these, thanks

Patch

diff --git a/mercurial/unionrepo.py b/mercurial/unionrepo.py
--- a/mercurial/unionrepo.py
+++ b/mercurial/unionrepo.py
@@ -209,18 +209,18 @@  class unionrepository(localrepo.localrep
         return self.changelog.rev(node)
 
     @localrepo.unfilteredpropertycache
     def manifest(self):
         return unionmanifest(self.svfs, self.repo2.svfs,
-                             self._clrev)
+                             self.unfiltered()._clrev)
 
     def url(self):
         return self._url
 
     def file(self, f):
         return unionfilelog(self.svfs, f, self.repo2.svfs,
-                            self._clrev, self)
+                            self.unfiltered()._clrev, self)
 
     def close(self):
         self.repo2.close()
 
     def cancopy(self):