[PATCH] bundle2: don't assume ordering of heads checked after push

Augie Fackler raf at durin42.com
Fri Jun 3 22:36:13 EDT 2016


On Wed, Jun 01, 2016 at 09:41:36PM +0200, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski at unity3d.com>
> # Date 1464810052 -7200
> #      Wed Jun 01 21:40:52 2016 +0200
> # Branch stable
> # Node ID 8e8f644bb2b3ff59af75d28056fd88481aca7a01
> # Parent  a9764ab80e11bcf6a37255db7dd079011f767c6c
> bundle2: don't assume ordering of heads checked after push

Queued for stable, thanks.

>
> Usually, the heads will have the same ordering in handlecheckheads. Insisting
> on the same ordering is however an unnecessary constraint that in some custom
> cases can cause pushes to fail even though the actual heads didn't change. This
> caused production issues for us in combination with the current version of
> https://bitbucket.org/Unity-Technologies/hgwebcachingproxy/ .
>
> diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
> --- a/mercurial/bundle2.py
> +++ b/mercurial/bundle2.py
> @@ -1453,7 +1453,7 @@ def handlecheckheads(op, inpart):
>      # Trigger a transaction so that we are guaranteed to have the lock now.
>      if op.ui.configbool('experimental', 'bundle2lazylocking'):
>          op.gettransaction()
> -    if heads != op.repo.heads():
> +    if sorted(heads) != sorted(op.repo.heads()):
>          raise error.PushRaced('repository changed while pushing - '
>                                'please try again')
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list