rebase: skip extinct revisions even if it has no successor in rebase set
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 12 Jul 2018 12:11:20 -0700
changeset 39328 94a4980695f8
parent 39327 a3af500a1362
child 39329 729082bb9938
rebase: skip extinct revisions even if it has no successor in rebase set Differential Revision: https://phab.mercurial-scm.org/D4408
hgext/rebase.py
tests/test-rebase-obsolete.t
--- a/hgext/rebase.py	Wed Jul 11 12:26:44 2018 -0700
+++ b/hgext/rebase.py	Thu Jul 12 12:11:20 2018 -0700
@@ -1891,7 +1891,7 @@
                 # If 'srcrev' has a successor in rebase set but none in
                 # destination (which would be catched above), we shall skip it
                 # and its descendants to avoid divergence.
-                if any(s in destmap for s in succrevs):
+                if srcrev in extinctrevs or any(s in destmap for s in succrevs):
                     obsoletewithoutsuccessorindestination.add(srcrev)
 
     return (
--- a/tests/test-rebase-obsolete.t	Wed Jul 11 12:26:44 2018 -0700
+++ b/tests/test-rebase-obsolete.t	Thu Jul 12 12:11:20 2018 -0700
@@ -1525,11 +1525,9 @@
   > A
   > EOF
 
-TODO: There doesn't seem to be much reason to fail this rebase. Make it pass?
   $ hg rebase -d D -s B
-  abort: this rebase will cause divergences from: 26805aba1e60
-  (to force the rebase please set experimental.evolution.allowdivergence=True)
-  [255]
+  rebasing 1:112478962961 "B" (B)
+  note: not rebasing 3:26805aba1e60 "C" (C) and its descendants as this would cause divergence
 
   $ cd ..