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

Mads Kiilerich mads at kiilerich.com
Wed Jun 1 19:41:36 UTC 2016


# 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

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


More information about the Mercurial-devel mailing list