[PATCH] bundle2: pull bookmark the old way if no bundle2 liskeys support (issue4701)
Martin von Zweigbergk
martinvonz at google.com
Mon Jun 8 17:55:47 CDT 2015
This seems to fix our problem, thanks! Pushed to the clowncopter.
On Mon, Jun 8, 2015 at 1:47 PM Pierre-Yves David <
pierre-yves.david at ens-lyon.org> wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at fb.com>
> # Date 1433795558 25200
> # Mon Jun 08 13:32:38 2015 -0700
> # Node ID ffe937d583d702dae10af83989695def011a6297
> # Parent 6fabde6ef4453ee6c2aa964184f6cf2c54483621
> bundle2: pull bookmark the old way if no bundle2 liskeys support
> (issue4701)
>
> All known servers implementation have listkeys support with bundle2, but
> people
> in the process of implementing new server may not. Let's be nice with them.
>
> diff --git a/mercurial/exchange.py b/mercurial/exchange.py
> --- a/mercurial/exchange.py
> +++ b/mercurial/exchange.py
> @@ -953,12 +953,16 @@ def _pullbookmarkbundle1(pullop):
>
> If not using bundle2, we have to fetch bookmarks before changeset
> discovery to reduce the chance and impact of race conditions."""
> if pullop.remotebookmarks is not None:
> return
> - if not _canusebundle2(pullop): # all bundle2 server now support
> listkeys
> - pullop.remotebookmarks = pullop.remote.listkeys('bookmarks')
> + if (_canusebundle2(pullop)
> + and 'listkeys' in bundle2.bundle2caps(pullop.remote)):
> + # all known bundle2 server now support listkeys, but lets be nice
> with
> + # new implementation.
> + return
> + pullop.remotebookmarks = pullop.remote.listkeys('bookmarks')
>
>
> @pulldiscovery('changegroup')
> def _pulldiscoverychangegroup(pullop):
> """discovery phase for the pull
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150608/f402656d/attachment.html>
More information about the Mercurial-devel
mailing list