diff mercurial/discovery.py @ 32709:16ada4cbb1a9

push: add a way to allow concurrent pushes on unrelated heads Client has a mechanism for the server to check that nothing changed server side since the client prepared a push. That check is wide and any head changed on the server will lead to an aborted push. We introduce a way for the client to send a less strict checking. That logic will check that no heads impacted by the push have been affected. If other unrelated heads (including named branches heads) have been affected, the push will proceed. This is very helpful for repositories with high developers traffic on different heads, a common setup. That behavior is currently controlled by an experimental option. The config should live in the "server" section but bike-shedding of the name will happen in the next changesets. Servers advertise this capability through a new bundle2 capability 'checkeads', using the value 'related'. The 'test-push-race.t' is updated to check that new capabilities on the documented cases.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 29 May 2017 05:53:58 +0200
parents 90cb4ec8df64
children 443e8543a125
line wrap: on
line diff
--- a/mercurial/discovery.py	Mon May 29 05:52:13 2017 +0200
+++ b/mercurial/discovery.py	Mon May 29 05:53:58 2017 +0200
@@ -332,6 +332,7 @@
         headssum = _headssummary(pushop)
     else:
         headssum = _oldheadssummary(repo, remoteheads, outgoing, inc)
+    pushop.pushbranchmap = headssum
     newbranches = [branch for branch, heads in headssum.iteritems()
                    if heads[0] is None]
     # 1. Check for new branches on the remote.