# HG changeset patch # User Dirkjan Ochtman # Date 1255289575 -7200 # Node ID f0c5c59d878deeff7633ccd64894b0cbadc158d9 # Parent c358f3e7893551fe08b90e5e5e001db6cac1213f# Parent 25858f9e65e84dc5a4ee82acd3ac287c2f21577e merge with mpm diff -r c358f3e78935 -r f0c5c59d878d hgext/rebase.py --- 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) diff -r c358f3e78935 -r f0c5c59d878d mercurial/windows.py diff -r c358f3e78935 -r f0c5c59d878d tests/run-tests.py --- 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]) diff -r c358f3e78935 -r f0c5c59d878d tests/test-diff-color --- 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 <&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 diff -r c358f3e78935 -r f0c5c59d878d tests/test-rebase-scenario-global.out --- 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