Comments
Patch
@@ -1916,10 +1916,11 @@ class localrepository(object):
if unfi.obsstore:
# this message are here for 80 char limit reason
mso = _("push includes obsolete changeset: %s!")
msu = _("push includes unstable changeset: %s!")
msb = _("push includes bumped changeset: %s!")
+ msd = _("push includes divergent changeset: %s!")
# If we are to push if there is at least one
# obsolete or unstable changeset in missing, at
# least one of the missinghead will be obsolete or
# unstable. So checking heads only is ok
for node in outgoing.missingheads:
@@ -1928,10 +1929,12 @@ class localrepository(object):
raise util.Abort(mso % ctx)
elif ctx.unstable():
raise util.Abort(msu % ctx)
elif ctx.bumped():
raise util.Abort(msb % ctx)
+ elif ctx.divergent():
+ raise util.Abort(msd % ctx)
discovery.checkheads(unfi, remote, outgoing,
remoteheads, newbranch,
bool(inc))
# create a changegroup from local
@@ -82,10 +82,20 @@ A_1 have two direct and divergent succes
392fd25390da
392fd25390da
$ hg log -r 'divergent()'
2:82623d38b9ba A_1
3:392fd25390da A_2
+
+check that mercurial refuse to push
+
+ $ hg init ../other
+ $ hg push ../other
+ pushing to ../other
+ searching for changes
+ abort: push includes divergent changeset: 82623d38b9ba!
+ [255]
+
$ cd ..
indirect divergence with known changeset
-------------------------------------------