diff mercurial/localrepo.py @ 18073:e411fd79ca69

obsolete: refuse to push divergent changeset As other troubles `unstable` and `bumped`. Followup patches may simplify the push code with unification of "obsolescence troubles" handling.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Sat, 10 Nov 2012 02:19:20 +0100
parents b35e3364f94a
children 739c88ff043c
line wrap: on
line diff
--- a/mercurial/localrepo.py	Wed Dec 12 03:20:49 2012 +0100
+++ b/mercurial/localrepo.py	Sat Nov 10 02:19:20 2012 +0100
@@ -1918,6 +1918,7 @@
                             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
@@ -1930,6 +1931,8 @@
                                     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))