[PATCH 2 of 2] discovery: properly filter changeset in 'peer.known' (issue4982)

Gregory Szorc gregory.szorc at gmail.com
Sun Dec 6 16:20:59 CST 2015


On Sun, Dec 6, 2015 at 2:10 PM, Pierre-Yves David <
pierre-yves.david at ens-lyon.org> wrote:

>
>
> On 12/06/2015 01:04 PM, Gregory Szorc wrote:
>
>> On Sun, Dec 6, 2015 at 12:54 PM, Pierre-Yves David
>> <pierre-yves.david at ens-lyon.org <mailto:pierre-yves.david at ens-lyon.org>>
>> wrote:
>>
>>     # HG changeset patch
>>     # User Pierre-Yves David <pierre-yves.david at fb.com
>>     <mailto:pierre-yves.david at fb.com>>
>>     # Date 1449101535 28800
>>     #      Wed Dec 02 16:12:15 2015 -0800
>>     # Node ID cce8d1dfcefa5495af7900ea5cff796691ca6d07
>>     # Parent  179e1f468d683a1b9e7e8df76af0690b454c4025
>>     # EXP-Topic fixknown
>>     # Available At http://hg.netv6.net/marmoute-wip/mercurial/
>>     #              hg pull http://hg.netv6.net/marmoute-wip/mercurial/
>>     -r cce8d1dfcefa
>>     discovery: properly filter changeset in 'peer.known' (issue4982)
>>
>>
>> This should be marked BC because it changes semantics of the "known"
>> wire protocol command. (The new semantics make sense to me modulo the
>> bug described below.)
>>
>
> Meh, this is fixing a bug in a wire protocol command that only affects
> people using an experimental extensions. I do not think it deserve any
> special flagging.
>

BC is BC. We want this to show up in the release notes so that anyone using
an experimental or unknown 3rd party extension isn't confounded when 3.7
changes behavior.


>
> [...]
>
>>     diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
>>     --- a/mercurial/localrepo.py
>>     +++ b/mercurial/localrepo.py
>>     @@ -806,16 +806,17 @@ class localrepository(object):
>>
>>               repo = (remote and remote.local()) and remote or self
>>               return repo[key].branch()
>>
>>           def known(self, nodes):
>>     -        nm = self.changelog.nodemap
>>     -        pc = self._phasecache
>>     +        cl = self.filtered('served').changelog
>>
>>
>> hgweb supports specifying the filter to serve with. Therefore, I believe
>> manually specifying a filter here is wrong, as a server started with `hg
>> --hidden serve` won't expose hidden changesets even though you told it
>> to. (This also likely points to a gap in test coverage.)
>>
>> Why can't you simply use self.changelog? wireproto.py should be
>> operating on a repo instance with the appropriate filter (if any)
>> already in place.
>>
>
>
> Ha, nice catch, I got a bit over zealous here. I've sending a V2 with the
> filtering call dropped.
>
>
> --
> Pierre-Yves David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20151206/d28402bc/attachment.html>


More information about the Mercurial-devel mailing list