[PATCH] bundlerepo: properly hidden revision in bundle (issue4945)

Sean Farley sean at farley.io
Mon Feb 22 17:19:27 EST 2016


Pierre-Yves David <pierre-yves.david at ens-lyon.org> writes:

> On 02/22/2016 10:52 PM, Sean Farley wrote:
>>
>> Pierre-Yves David <pierre-yves.david at ens-lyon.org> writes:
>>
>>> # HG changeset patch
>>> # User Pierre-Yves David <pierre-yves.david at fb.com>
>>> # Date 1456162540 -3600
>>> #      Mon Feb 22 18:35:40 2016 +0100
>>> # Node ID c3f0732d8bfcda5c430b5bf0fc21e22580fa8bbc
>>> # Parent  28e1694ca60056d609ae2c8e0ad5cb2891416ea3
>>> # Available At http://hg.netv6.net/marmoute-wip/mercurial/
>>> #              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r c3f0732d8bfc
>>> bundlerepo: properly hidden revision in bundle (issue4945)
>>>
>>> The bundlerepository have to do some special magic to handle linkrev of the
>>> bundled filerev. 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
>>> @@ -360,11 +360,12 @@ class bundlerepository(localrepo.localre
>>>                       if not c:
>>>                           break
>>>
>>>           if f in self.bundlefilespos:
>>>               self.bundle.seek(self.bundlefilespos[f])
>>> -            return bundlefilelog(self.svfs, f, self.bundle, self.changelog.rev)
>>> +            linkmapper = self.unfiltered().changelog.rev
>>> +            return bundlefilelog(self.svfs, f, self.bundle, linkmapper)
>>
>> Would this logic also be the same to fix issue5070?
>> http://bz.mercurial-scm.org/show_bug.cgi?id=5070
>
> Probably. do you have a traceback handy?

>From the script on the issue (I'll update the report with this output):

./script.py
P1 hidden: False
P2 hidden: False
CMP:
Traceback (most recent call last):
  File "./script.py", line 20, in <module>
    print "CMP:", fctx.cmp(p2.filectx(f))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/context.py", line 792, in cmp
    if (fctx._filerev is None
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/util.py", line 723, in __get__
    result = self.func(obj)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/context.py", line 688, in _filerev
    return self._filelog.rev(self._filenode)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/util.py", line 723, in __get__
    result = self.func(obj)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/context.py", line 663, in _filelog
    return self._repo.file(self._path)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/unionrepo.py", line 221, in file
    self._clrev, self)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/unionrepo.py", line 173, in __init__
    linkmapper)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/unionrepo.py", line 60, in __init__
    link = linkmapper(linkrev)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/unionrepo.py", line 209, in _clrev
    return self.changelog.rev(node)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/changelog.py", line 212, in rev
    _('filtered node'))
mercurial.error.FilteredLookupError: 00changelog.i at edcc273ded511a1e48b49133b020eaf7a625cf2a: filtered node


More information about the Mercurial-devel mailing list