diff tests/test-rebase-scenario-global @ 9578:341182ac95e4

rebase: return early when source is descendant of destination This only happens when using --base (or no source selection options), as rebase already aborts in this situation when using --source. Without this change you get an abort from the underlying merge, and the repository is in a different state than you started with (the working dir parent is changed).
author Sune Foldager <cryo@cyanite.org>
date Thu, 08 Oct 2009 10:39:43 +0200
parents 8766fee6f225
children b345b1cc124f
line wrap: on
line diff
--- a/tests/test-rebase-scenario-global	Thu Oct 08 10:07:41 2009 +0200
+++ b/tests/test-rebase-scenario-global	Thu Oct 08 10:39:43 2009 +0200
@@ -70,7 +70,7 @@
 hg rebase -s 3 -d 1 2>&1 | sed 's/\(saving bundle to \).*/\1/'
 hg glog  --template '{rev}: {desc}\n'
 
-echo '% These will fail'
+echo '% These will fail (using --source)'
 createrepo > /dev/null 2>&1
 echo '% E onto D - rebase onto an ancestor'
 hg rebase -s 4 -d 3
@@ -79,4 +79,13 @@
 echo '% E onto B - merge revision with both parents not in ancestors of target'
 hg rebase -s 4 -d 1
 
+echo
+echo '% These will abort gracefully (using --base)'
+echo '% E onto E - rebase onto same changeset'
+hg rebase -b 4 -d 4
+echo '% E onto D - rebase onto an ancestor'
+hg rebase -b 4 -d 3
+echo '% D onto E - rebase onto a descendant'
+hg rebase -b 3 -d 4
+
 exit 0