diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -1323,7 +1323,8 @@ def getrepocaps(repo, allowpushback=Fals caps['obsmarkers'] = supportedformat if allowpushback: caps['pushback'] = () - if not repo.ui.configbool('experimental', 'checkheads-strict', True): + cpmode = repo.ui.config('server', 'concurrent-push-mode', 'strict') + if cpmode == 'check-related': caps['checkheads'] = ('related',) return caps diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt --- a/mercurial/help/config.txt +++ b/mercurial/help/config.txt @@ -1694,6 +1694,17 @@ Controls generic server settings. are highly recommended. Partial clones will still be allowed. (default: False) +``concurrent-push-mode`` + Level of allowed race condition between two pushing clients. + + - 'strict': push is abort if another client touched the repository + while the push was preparing. (default) + - 'check-related': push is only aborted if it affects head that got also + affected while the push was preparing. + + This requires compatible client (version 4.3 and later). Old client will + use 'strict'. + ``validate`` Whether to validate the completeness of pushed changesets by checking that all new file revisions specified in manifests are diff --git a/tests/test-push-race.t b/tests/test-push-race.t --- a/tests/test-push-race.t +++ b/tests/test-push-race.t @@ -111,8 +111,8 @@ We tests multiple cases: #if unrelated $ cat >> $HGRCPATH << EOF - > [experimental] - > checkheads-strict = no + > [server] + > concurrent-push-mode = check-related > EOF #endif