# HG changeset patch # User Kostia Balytskyi # Date 2016-02-17 20:31:34 # Node ID 6411140aeda98aa32d61c2f08390d036e89c8b73 # Parent d3da97e58d42fa9427d55005f9a2941ec4bd9a4c rebase: add potential divergent commit hashes to error message (issue5086) diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -307,10 +307,13 @@ def rebase(ui, repo, **opts): divergencebasecandidates = rebaseobsrevs - rebaseobsskipped if divergencebasecandidates and not divergenceok: - msg = _("this rebase will cause divergence") + divhashes = (str(repo[r]) + for r in divergencebasecandidates) + msg = _("this rebase will cause " + "divergences from: %s") h = _("to force the rebase please set " "rebase.allowdivergence=True") - raise error.Abort(msg, hint=h) + raise error.Abort(msg % (",".join(divhashes),), hint=h) # - plain prune (no successor) changesets are rebased # - split changesets are not rebased if at least one of the diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t --- a/tests/test-rebase-obsolete.t +++ b/tests/test-rebase-obsolete.t @@ -771,7 +771,7 @@ If a rebase is going to create divergenc phases: 8 draft unstable: 1 changesets $ hg rebase -s 10 -d 12 - abort: this rebase will cause divergence + abort: this rebase will cause divergences from: 121d9e3bc4c6 (to force the rebase please set rebase.allowdivergence=True) [255] $ hg log -G