# HG changeset patch # User Pierre-Yves David # Date 1352510360 -3600 # Node ID e411fd79ca698a5d7c59b826acb7c52e07f14648 # Parent 03604f46d48a8380f63fd803662c8ba13d7ab27d 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. diff -r 03604f46d48a -r e411fd79ca69 mercurial/localrepo.py --- 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)) diff -r 03604f46d48a -r e411fd79ca69 tests/test-obsolete-divergent.t --- a/tests/test-obsolete-divergent.t Wed Dec 12 03:20:49 2012 +0100 +++ b/tests/test-obsolete-divergent.t Sat Nov 10 02:19:20 2012 +0100 @@ -84,6 +84,16 @@ $ 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 ..