Patchwork [2,of,2] unionrepo: properly handle hidden linkrev in revlog (issue4945)

login
register
mail settings
Submitter Pierre-Yves David
Date Feb. 22, 2016, 11:31 p.m.
Message ID <f18da330633071bf0a84.1456183888@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/13302/
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 1456180564 -3600
#      Mon Feb 22 23:36:04 2016 +0100
# Node ID f18da330633071bf0a84f6fda6d0b244f10d4f26
# Parent  0f3c3d414e599f9445f0b86901c7ffefeabdcacb
# Available At http://hg.netv6.net/marmoute-wip/mercurial/
#              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r f18da3306330
unionrepo: properly handle hidden linkrev in revlog (issue4945)

The bundlerepository have to do some special magic to handle linkrev of the
bundled 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.
Sean Farley - Feb. 22, 2016, 11:33 p.m.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> writes:

> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1456180564 -3600
> #      Mon Feb 22 23:36:04 2016 +0100
> # Node ID f18da330633071bf0a84f6fda6d0b244f10d4f26
> # Parent  0f3c3d414e599f9445f0b86901c7ffefeabdcacb
> # Available At http://hg.netv6.net/marmoute-wip/mercurial/
> #              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r f18da3306330
> unionrepo: properly handle hidden linkrev in revlog (issue4945)

(issue5070), actually.

> The bundlerepository have to do some special magic to handle linkrev of the

Probably mean unionrepository.

> bundled filerev and manifestrev. That logic was done from a repoview and
> obsolescence marker affecting bundled changeset could lead to a crash. We now

Unioned changeset.

> ensure we operate on unfiltered repository.

I tested that it fixes the bug I reported, so yay!

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