rebase: add potential divergent commit hashes to error message (issue5086)
authorKostia Balytskyi <ikostia@fb.com>
Wed, 17 Feb 2016 20:31:34 +0000
changeset 28188 6411140aeda9
parent 28187 d3da97e58d42
child 28189 fac3a24be50e
rebase: add potential divergent commit hashes to error message (issue5086)
hgext/rebase.py
tests/test-rebase-obsolete.t
--- a/hgext/rebase.py	Fri Feb 19 17:50:28 2016 +0100
+++ b/hgext/rebase.py	Wed Feb 17 20:31:34 2016 +0000
@@ -307,10 +307,13 @@
                 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
--- a/tests/test-rebase-obsolete.t	Fri Feb 19 17:50:28 2016 +0100
+++ b/tests/test-rebase-obsolete.t	Wed Feb 17 20:31:34 2016 +0000
@@ -771,7 +771,7 @@
   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