--- a/hgext/rebase.py Sat Oct 10 12:24:09 2009 +0200
+++ b/hgext/rebase.py Sun Oct 11 21:32:55 2009 +0200
@@ -381,9 +381,9 @@
if src:
commonbase = repo[src].ancestor(repo[dest])
if commonbase == repo[src]:
- raise util.Abort(_('cannot rebase an ancestor'))
+ raise util.Abort(_('source is ancestor of destination'))
if commonbase == repo[dest]:
- raise util.Abort(_('cannot rebase a descendant'))
+ raise util.Abort(_('source is descendant of destination'))
source = repo[src].rev()
else:
if base:
@@ -392,15 +392,19 @@
cwd = repo['.'].rev()
if cwd == dest:
- repo.ui.debug('already working on current\n')
+ repo.ui.debug('source and destination are the same\n')
return None
targetancestors = set(repo.changelog.ancestors(dest))
if cwd in targetancestors:
- repo.ui.debug('already working on the current branch\n')
+ repo.ui.debug('source is ancestor of destination\n')
return None
cwdancestors = set(repo.changelog.ancestors(cwd))
+ if dest in cwdancestors:
+ repo.ui.debug('source is descendant of destination\n')
+ return None
+
cwdancestors.add(cwd)
rebasingbranch = cwdancestors - targetancestors
source = min(rebasingbranch)
--- a/tests/run-tests.py Sat Oct 10 12:24:09 2009 +0200
+++ b/tests/run-tests.py Sun Oct 11 21:32:55 2009 +0200
@@ -102,6 +102,8 @@
help="retest failed tests")
parser.add_option("-s", "--cover_stdlib", action="store_true",
help="print a test coverage report inc. standard libraries")
+ parser.add_option("-S", "--noskips", action="store_true",
+ help="don't report skip tests verbosely")
parser.add_option("-t", "--timeout", type="int",
help="kill errant tests after TIMEOUT seconds"
" (default: $%s or %d)" % defaults['timeout'])
@@ -640,8 +642,9 @@
vlog('pid %d exited, status %d' % (pid, status))
failures |= status
print
- for s in skips:
- print "Skipped %s: %s" % (s[0], s[1])
+ if not options.noskips:
+ for s in skips:
+ print "Skipped %s: %s" % (s[0], s[1])
for s in fails:
print "Failed %s: %s" % (s[0], s[1])
--- a/tests/test-diff-color Sat Oct 10 12:24:09 2009 +0200
+++ b/tests/test-diff-color Sun Oct 11 21:32:55 2009 +0200
@@ -33,4 +33,18 @@
hg diff --nodates --color=always
echo '% --unified=2'
-hg diff --nodates -U 2 --color=always
\ No newline at end of file
+hg diff --nodates -U 2 --color=always
+
+echo "record=" >> $HGRCPATH
+echo "[ui]" >> $HGRCPATH
+echo "interactive=true" >> $HGRCPATH
+echo "[diff]" >> $HGRCPATH
+echo "git=True" >> $HGRCPATH
+
+echo % record
+chmod 0755 a
+hg record --color=always -m moda a <<EOF
+y
+y
+EOF
+echo
--- a/tests/test-diff-color.out Sat Oct 10 12:24:09 2009 +0200
+++ b/tests/test-diff-color.out Sun Oct 11 21:32:55 2009 +0200
@@ -23,3 +23,18 @@
[0;32m+dd[0m
a
a
+% record
+[0;1mdiff --git a/a b/a[0m
+[0;36;1mold mode 100644[0m
+[0;36;1mnew mode 100755[0m
+1 hunks, 2 lines changed
+examine changes to 'a'? [Ynsfdaq?] [0;35m@@ -2,7 +2,7 @@[0m
+ c
+ a
+ a
+[0;31m-b[0m
+[0;32m+dd[0m
+ a
+ a
+ c
+record this change to 'a'? [Ynsfdaq?]
--- a/tests/test-import Sat Oct 10 12:24:09 2009 +0200
+++ b/tests/test-import Sun Oct 11 21:32:55 2009 +0200
@@ -345,7 +345,6 @@
cd oddcreate
hg import --no-commit ../create.patch
cat foo
-cd ..
echo % 'first line mistaken for email headers (issue 1859)'
hg init emailconfusion
--- a/tests/test-rebase-scenario-global Sat Oct 10 12:24:09 2009 +0200
+++ b/tests/test-rebase-scenario-global Sun Oct 11 21:32:55 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
--- a/tests/test-rebase-scenario-global.out Sat Oct 10 12:24:09 2009 +0200
+++ b/tests/test-rebase-scenario-global.out Sun Oct 11 21:32:55 2009 +0200
@@ -127,10 +127,18 @@
|/
o 0: A
-% These will fail
+% These will fail (using --source)
% E onto D - rebase onto an ancestor
-abort: cannot rebase a descendant
+abort: source is descendant of destination
% D onto E - rebase onto a descendant
-abort: cannot rebase an ancestor
+abort: source is ancestor of destination
% E onto B - merge revision with both parents not in ancestors of target
abort: cannot use revision 4 as base, result would have 3 parents
+
+% These will abort gracefully (using --base)
+% E onto E - rebase onto same changeset
+nothing to rebase
+% E onto D - rebase onto an ancestor
+nothing to rebase
+% D onto E - rebase onto a descendant
+nothing to rebase