[Request] [+ ] D10832: rewriteutil: add pointer to help text when rewrite would cause divergence

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu Jun 3 17:50:54 UTC 2021


martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The evolve extension's version of the hint has this pointer. I missed
  it when I moved it to core. This is pretty much the same as
  D10723 <https://phab.mercurial-scm.org/D10723>. Turns out I missed two places :(

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10832

AFFECTED FILES
  mercurial/rewriteutil.py
  tests/test-amend.t

CHANGE DETAILS

diff --git a/tests/test-amend.t b/tests/test-amend.t
--- a/tests/test-amend.t
+++ b/tests/test-amend.t
@@ -241,6 +241,13 @@
   abort: cannot amend 112478962961, as that creates content-divergence with 16084da537dd
   (add --verbose for details or see 'hg help evolution.instability')
   [10]
+  $ hg amend -m divergent --verbose
+  abort: cannot amend 112478962961, as that creates content-divergence with 16084da537dd
+      changeset 112478962961 already has a successor in changeset 16084da537dd
+      rewriting changeset 112478962961 would create "content-divergence"
+      set experimental.evolution.allowdivergence=True to skip this check
+  (see 'hg help evolution.instability' for details on content-divergence)
+  [10]
   $ hg amend -m divergent --config experimental.evolution.allowdivergence=true
   2 new content-divergent changesets
 #endif
diff --git a/mercurial/rewriteutil.py b/mercurial/rewriteutil.py
--- a/mercurial/rewriteutil.py
+++ b/mercurial/rewriteutil.py
@@ -111,7 +111,12 @@
                     b'    set experimental.evolution.allowdivergence=True to '
                     b'skip this check'
                 ) % (base_ctx, other_ctx, local_ctx)
-                raise error.InputError(msg)
+                raise error.InputError(
+                    msg,
+                    hint=_(
+                        b"see 'hg help evolution.instability' for details on content-divergence"
+                    ),
+                )
             else:
                 raise error.InputError(
                     msg,



To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20210603/f3c9341c/attachment.html>


More information about the Mercurial-patches mailing list