changeset 11198:b345b1cc124f

rebase: use helpers.sh in tests
author Matt Mackall <mpm@selenic.com>
date Wed, 19 May 2010 20:20:12 -0500
parents 4bb4895e1693
children 4b1f4e473c17
files tests/helpers.sh tests/test-bookmarks-rebase tests/test-rebase-abort tests/test-rebase-abort.out tests/test-rebase-cache tests/test-rebase-check-restore tests/test-rebase-check-restore.out tests/test-rebase-collapse tests/test-rebase-conflicts tests/test-rebase-detach tests/test-rebase-interruptions tests/test-rebase-interruptions.out tests/test-rebase-issue-noparam-single-rev tests/test-rebase-keep-branch tests/test-rebase-keep-branch.out tests/test-rebase-mq tests/test-rebase-mq-skip tests/test-rebase-mq.out tests/test-rebase-newancestor tests/test-rebase-parameters tests/test-rebase-pull tests/test-rebase-rename tests/test-rebase-scenario-global
diffstat 23 files changed, 96 insertions(+), 88 deletions(-) [+]
line wrap: on
line diff
--- a/tests/helpers.sh	Wed May 19 19:46:39 2010 -0500
+++ b/tests/helpers.sh	Wed May 19 20:20:12 2010 -0500
@@ -2,8 +2,16 @@
 
 hideport() { sed "s/localhost:$HGPORT/localhost:\$HGPORT/"; }
 
-repr() { python -c "import sys; print repr(sys.stdin.read()).replace('\\n', '\n')" }
+repr() { python -c "import sys; print repr(sys.stdin.read()).replace('\\n', '\n')"; }
+
+hidehex() { python -c 'import sys, re; print re.replace("\b[0-9A-Fa-f]{12,40}", "X" * 12)'; }
+
+hidetmp() { sed "s/$HGTMP/\$HGTMP/"; }
 
-hidehex() { python -c 'import sys, re; print re.replace("\b[0-9A-Fa-f]{12,40}", "X" * 12)' }
+hidebackup() { sed 's/\(saving bundle to \).*/\1/'; }
 
-hidetmp() { sed "s/$HGTMP/\$HGTMP/"; }
\ No newline at end of file
+cleanrebase() {
+    sed -e 's/\(Rebase status stored to\).*/\1/'  \
+        -e 's/\(Rebase status restored from\).*/\1/' \
+        -e 's/\(saving bundle to \).*/\1/';
+}
--- a/tests/test-bookmarks-rebase	Wed May 19 19:46:39 2010 -0500
+++ b/tests/test-bookmarks-rebase	Wed May 19 20:20:12 2010 -0500
@@ -1,15 +1,11 @@
 #!/bin/sh
 
+source $TESTDIR/helpers.sh
+
 echo "[extensions]" >> $HGRCPATH
 echo "rebase=" >> $HGRCPATH
 echo "bookmarks=" >> $HGRCPATH
 
-cleanoutput () {
-    sed -e 's/\(Rebase status stored to\).*/\1/'  \
-        -e 's/\(Rebase status restored from\).*/\1/' \
-        -e 's/\(saving bundle to \).*/\1/'
-}
-
 echo % initialize repository
 hg init
 
@@ -33,6 +29,6 @@
 hg bookmark
 
 echo % rebase
-hg rebase -s two -d one 2>&1 | cleanoutput
+hg rebase -s two -d one 2>&1 | cleanrebase
 
 hg log
--- a/tests/test-rebase-abort	Wed May 19 19:46:39 2010 -0500
+++ b/tests/test-rebase-abort	Wed May 19 20:20:12 2010 -0500
@@ -1,15 +1,11 @@
 #!/bin/sh
 
+source $TESTDIR/helpers.sh
+
 echo "[extensions]" >> $HGRCPATH
 echo "graphlog=" >> $HGRCPATH
 echo "rebase=" >> $HGRCPATH
 
-cleanoutput () {
-    sed -e 's/\(Rebase status stored to\).*/\1/'  \
-        -e 's/\(Rebase status restored from\).*/\1/' \
-        -e 's/\(saving bundle to \).*/\1/'
-}
-
 hg init a
 cd a
 echo 'c1' >common
@@ -35,10 +31,10 @@
 
 echo
 echo '% Conflicting rebase'
-hg rebase -s 3 -d 2 2>&1 | cleanoutput
+hg rebase -s 3 -d 2 | cleanrebase
 
 echo
 echo '% Abort'
-hg rebase --abort 2>&1 | cleanoutput
+hg rebase --abort | cleanrebase
 
 hg glog  --template '{rev}: {desc}\n'
--- a/tests/test-rebase-abort.out	Wed May 19 19:46:39 2010 -0500
+++ b/tests/test-rebase-abort.out	Wed May 19 20:20:12 2010 -0500
@@ -12,10 +12,10 @@
 
 
 % Conflicting rebase
-merging common
 warning: conflicts during merge.
 merging common failed!
 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
+merging common
 
 % Abort
 rebase aborted
--- a/tests/test-rebase-cache	Wed May 19 19:46:39 2010 -0500
+++ b/tests/test-rebase-cache	Wed May 19 20:20:12 2010 -0500
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+source $TESTDIR/helpers.sh
+
 createrepo() {
     rm -rf repo
     hg init repo
@@ -52,7 +54,7 @@
 
 echo
 echo '% Rebase part of branch2 (5-6) onto branch3 (8)'
-hg --config extensions.hgext.rebase= rebase --detach -s 5 -d 8 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg --config extensions.hgext.rebase= rebase --detach -s 5 -d 8 | hidebackup
 
 echo
 echo '% Branches'
@@ -70,7 +72,7 @@
 createrepo > /dev/null 2>&1
 hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n'
 
-hg --config extensions.hgext.rebase= rebase --detach -s 8 -d 6 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg --config extensions.hgext.rebase= rebase --detach -s 8 -d 6 | hidebackup
 
 echo
 echo '% Branches'
@@ -89,7 +91,7 @@
 createrepo > /dev/null 2>&1
 hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n'
 
-hg --config extensions.hgext.rebase= rebase --detach -s 7 -d 6 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg --config extensions.hgext.rebase= rebase --detach -s 7 -d 6 | hidebackup
 
 echo
 echo '% Branches'
--- a/tests/test-rebase-check-restore	Wed May 19 19:46:39 2010 -0500
+++ b/tests/test-rebase-check-restore	Wed May 19 20:20:12 2010 -0500
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+source $TESTDIR/helpers.sh
+
 echo "[extensions]" >> $HGRCPATH
 echo "graphlog=" >> $HGRCPATH
 echo "rebase=" >> $HGRCPATH
@@ -41,28 +43,28 @@
 echo "% - Rebasing B onto E - check keep"
 createrepo > /dev/null 2>&1
 hg glog  --template '{rev}:{desc}:{branches}\n'
-hg rebase -s 1 -d 4 --keep 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase -s 1 -d 4 --keep | hidebackup
 
 echo
 echo "% - Solve the conflict and go on"
 echo 'conflict solved' > A
 rm A.orig
 hg resolve -m A
-hg rebase --continue 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase --continue | hidebackup
 hg glog  --template '{rev}:{desc}:{branches}\n'
 
 echo
 echo "% - Rebase F onto E - check keepbranches"
 createrepo > /dev/null 2>&1
 hg glog  --template '{rev}:{desc}:{branches}\n'
-hg rebase -s 5 -d 4 --keepbranches 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase -s 5 -d 4 --keepbranches | hidebackup
 
 echo
 echo "% - Solve the conflict and go on"
 echo 'conflict solved' > A
 rm A.orig
 hg resolve -m A
-hg rebase --continue 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase --continue 2>&1 | hidebackup
 hg glog  --template '{rev}:{desc}:{branches}\n'
 
 exit 0
--- a/tests/test-rebase-check-restore.out	Wed May 19 19:46:39 2010 -0500
+++ b/tests/test-rebase-check-restore.out	Wed May 19 20:20:12 2010 -0500
@@ -12,10 +12,10 @@
 |/
 o  0:A:
 
-merging A
 warning: conflicts during merge.
 merging A failed!
 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
+merging A
 
 % - Solve the conflict and go on
 rebase completed
@@ -49,10 +49,10 @@
 |/
 o  0:A:
 
-merging A
 warning: conflicts during merge.
 merging A failed!
 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
+merging A
 
 % - Solve the conflict and go on
 adding branch
--- a/tests/test-rebase-collapse	Wed May 19 19:46:39 2010 -0500
+++ b/tests/test-rebase-collapse	Wed May 19 20:20:12 2010 -0500
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+source $TESTDIR/helpers.sh
+
 echo "[extensions]" >> $HGRCPATH
 echo "graphlog=" >> $HGRCPATH
 echo "rebase=" >> $HGRCPATH
@@ -43,7 +45,7 @@
 hg glog  --template '{rev}: {desc}\n'
 echo '% Rebasing B onto H'
 hg up -C 3
-hg rebase --collapse --keepbranches 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase --collapse --keepbranches | hidebackup
 hg glog  --template '{rev}: {desc}\n'
 echo "Expected A, B, C, D, F, H"
 hg manifest
@@ -51,7 +53,7 @@
 createrepo > /dev/null 2>&1
 echo
 echo '% Rebasing G onto H'
-hg rebase --base 6 --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase --base 6 --collapse | hidebackup
 hg glog  --template '{rev}: {desc}\n'
 echo "Expected A, E, F, H"
 hg manifest
@@ -91,7 +93,7 @@
 
 echo
 echo '% Rebase and collapse - E onto H'
-hg rebase -s 4 --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase -s 4 --collapse | hidebackup
 hg glog  --template '{rev}: {desc}\n'
 echo "Expected A, B, C, E, F, H"
 hg manifest
@@ -130,7 +132,7 @@
 
 echo
 echo '% Rebase and collapse - E onto I'
-hg rebase -s 4 --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase -s 4 --collapse | hidebackup
 
 hg glog  --template '{rev}: {desc}\n'
 
@@ -166,7 +168,7 @@
 
 echo
 echo '% Rebase and collapse - B onto F'
-hg rebase -s 1 --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase -s 1 --collapse | hidebackup
 
 hg glog  --template '{rev}: {desc}\n'
 
--- a/tests/test-rebase-conflicts	Wed May 19 19:46:39 2010 -0500
+++ b/tests/test-rebase-conflicts	Wed May 19 20:20:12 2010 -0500
@@ -1,15 +1,11 @@
 #!/bin/sh
 
+source $TESTDIR/helpers.sh
+
 echo "[extensions]" >> $HGRCPATH
 echo "graphlog=" >> $HGRCPATH
 echo "rebase=" >> $HGRCPATH
 
-cleanoutput () {
-    sed -e 's/\(Rebase status stored to\).*/\1/'  \
-        -e 's/\(Rebase status restored from\).*/\1/' \
-        -e 's/\(saving bundle to \).*/\1/'
-}
-
 hg init a
 cd a
 echo 'c1' >common
@@ -53,7 +49,7 @@
 echo '% Conclude rebase'
 echo 'resolved merge' >common
 hg resolve -m common
-hg rebase --continue 2>&1 | cleanoutput
+hg rebase --continue | cleanrebase
 
 hg glog  --template '{rev}: {desc}\n'
 
--- a/tests/test-rebase-detach	Wed May 19 19:46:39 2010 -0500
+++ b/tests/test-rebase-detach	Wed May 19 20:20:12 2010 -0500
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+source $TESTDIR/helpers.sh
+
 echo "[extensions]" >> $HGRCPATH
 echo "graphlog=" >> $HGRCPATH
 echo "rebase=" >> $HGRCPATH
@@ -33,7 +35,7 @@
 createrepo > /dev/null 2>&1
 hg glog  --template '{rev}: {desc}\n'
 echo '% Rebasing D onto E detaching from C'
-hg rebase --detach -s 3 -d 4 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase --detach -s 3 -d 4 | hidebackup
 hg glog  --template '{rev}: {desc}\n'
 echo "Expected A, D, E"
 hg manifest
@@ -42,7 +44,7 @@
 createrepo > /dev/null 2>&1
 hg glog  --template '{rev}: {desc}\n'
 echo '% Rebasing C onto E detaching from B'
-hg rebase --detach -s 2 -d 4 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase --detach -s 2 -d 4 | hidebackup
 hg glog  --template '{rev}: {desc}\n'
 echo "Expected A, C, D, E"
 hg manifest
@@ -51,7 +53,7 @@
 createrepo > /dev/null 2>&1
 hg glog  --template '{rev}: {desc}\n'
 echo '% Rebasing B onto E using detach (same as not using it)'
-hg rebase --detach -s 1 -d 4 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase --detach -s 1 -d 4 | hidebackup
 hg glog  --template '{rev}: {desc}\n'
 echo "Expected A, B, C, D, E"
 hg manifest
@@ -60,7 +62,7 @@
 createrepo > /dev/null 2>&1
 hg glog  --template '{rev}: {desc}\n'
 echo '% Rebasing C onto E detaching from B and collapsing'
-hg rebase --detach --collapse -s 2 -d 4 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase --detach --collapse -s 2 -d 4 | hidebackup
 hg glog  --template '{rev}: {desc}\n'
 echo "Expected A, C, D, E"
 hg manifest
--- a/tests/test-rebase-interruptions	Wed May 19 19:46:39 2010 -0500
+++ b/tests/test-rebase-interruptions	Wed May 19 20:20:12 2010 -0500
@@ -1,5 +1,6 @@
 #!/bin/sh
 
+source $TESTDIR/helpers.sh
 echo "[extensions]" >> $HGRCPATH
 echo "graphlog=" >> $HGRCPATH
 echo "rebase=" >> $HGRCPATH
@@ -38,7 +39,7 @@
 
 echo
 echo "% - Rebasing B onto E"
-hg rebase -s 1 -d 4 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase -s 1 -d 4 | hidebackup
 
 echo
 echo "% - Force a commit on C during the interruption"
@@ -66,7 +67,7 @@
 
 echo
 echo "% Rebasing B onto E"
-hg rebase -s 1 -d 4 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase -s 1 -d 4 | hidebackup
 
 echo
 echo "% Force a commit on B' during the interruption"
--- a/tests/test-rebase-interruptions.out	Wed May 19 19:46:39 2010 -0500
+++ b/tests/test-rebase-interruptions.out	Wed May 19 20:20:12 2010 -0500
@@ -11,10 +11,10 @@
 
 
 % - Rebasing B onto E
-merging A
 warning: conflicts during merge.
 merging A failed!
 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
+merging A
 
 % - Force a commit on C during the interruption
 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
@@ -73,10 +73,10 @@
 
 
 % Rebasing B onto E
-merging A
 warning: conflicts during merge.
 merging A failed!
 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
+merging A
 
 % Force a commit on B' during the interruption
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- a/tests/test-rebase-issue-noparam-single-rev	Wed May 19 19:46:39 2010 -0500
+++ b/tests/test-rebase-issue-noparam-single-rev	Wed May 19 20:20:12 2010 -0500
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+source $TESTDIR/helpers.sh
+
 echo "[extensions]" >> $HGRCPATH
 echo "graphlog=" >> $HGRCPATH
 echo "rebase=" >> $HGRCPATH
@@ -25,7 +27,7 @@
 echo
 echo '% Rebase with no arguments - single revision in source branch'
 hg update -C 2
-hg rebase 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase | hidebackup
 hg glog --template '{rev}:{desc}\n'
 
 cd ..
@@ -45,5 +47,5 @@
 echo
 echo '% Rebase with no arguments - single revision in target branch'
 hg update -C 3
-hg rebase 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase 2>&1 | hidebackup
 hg glog --template '{rev}:{desc}\n'
--- a/tests/test-rebase-keep-branch	Wed May 19 19:46:39 2010 -0500
+++ b/tests/test-rebase-keep-branch	Wed May 19 20:20:12 2010 -0500
@@ -26,7 +26,7 @@
 echo
 echo '% Rebase a branch while preserving the branch name'
 hg update -C 3
-hg rebase -b 4 -d 3 --keepbranches 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase -b 4 -d 3 --keepbranches -q
 hg glog --template '{rev}:{desc}:{branches}\n'
 echo '% dirstate branch should be "notdefault"'
 hg branch
--- a/tests/test-rebase-keep-branch.out	Wed May 19 19:46:39 2010 -0500
+++ b/tests/test-rebase-keep-branch.out	Wed May 19 20:20:12 2010 -0500
@@ -13,12 +13,6 @@
 
 % Rebase a branch while preserving the branch name
 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding branch
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-rebase completed
 @  4:r1:notdefault
 |
 o  3:l2:
--- a/tests/test-rebase-mq	Wed May 19 19:46:39 2010 -0500
+++ b/tests/test-rebase-mq	Wed May 19 20:20:12 2010 -0500
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+source $TESTDIR/helpers.sh
+
 echo "[extensions]" >> $HGRCPATH
 echo "graphlog=" >> $HGRCPATH
 echo "rebase=" >> $HGRCPATH
@@ -58,13 +60,13 @@
 echo '% Fix the 1st conflict'
 echo 'mq1r1' > f
 hg resolve -m f
-hg rebase -c 2>&1 | sed -e 's/\(saving bundle to \).*/\1/'
+hg rebase -c | hidebackup
 
 echo
 echo '% Fix the 2nd conflict'
 echo 'mq1r1mq2' > f
 hg resolve -m f
-hg rebase -c 2>&1 | sed -e 's/\(saving bundle to \).*/\1/'
+hg rebase -c | hidebackup
 
 hg glog  --template '{rev} {desc} tags: {tags}\n'
 
@@ -109,7 +111,7 @@
 
 echo
 echo '% Rebase the applied mq patches'
-hg rebase -s 2 -d 1 --quiet 2>&1 | sed -e 's/\(saving bundle to \).*/\1/'
+hg rebase -s 2 -d 1 --quiet
 
 echo '% And the patches are correct'
 echo '% Git patch'
--- a/tests/test-rebase-mq-skip	Wed May 19 19:46:39 2010 -0500
+++ b/tests/test-rebase-mq-skip	Wed May 19 20:20:12 2010 -0500
@@ -2,6 +2,8 @@
 # This emulates the effects of an hg pull --rebase in which the remote repo 
 # already has one local mq patch
 
+source $TESTDIR/helpers.sh
+
 echo "[extensions]" >> $HGRCPATH
 echo "graphlog=" >> $HGRCPATH
 echo "rebase=" >> $HGRCPATH
@@ -40,5 +42,5 @@
 echo
 echo '% Rebase'
 hg up -C qtip
-hg rebase  2>&1 | sed -e 's/\(saving bundle to \).*/\1/'
+hg rebase | hidebackup
 hg glog  --template '{rev} {desc} tags: {tags}\n'
--- a/tests/test-rebase-mq.out	Wed May 19 19:46:39 2010 -0500
+++ b/tests/test-rebase-mq.out	Wed May 19 20:20:12 2010 -0500
@@ -21,10 +21,10 @@
 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
 
 % Fix the 1st conflict
-merging f
 warning: conflicts during merge.
 merging f failed!
 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
+merging f
 
 % Fix the 2nd conflict
 adding branch
--- a/tests/test-rebase-newancestor	Wed May 19 19:46:39 2010 -0500
+++ b/tests/test-rebase-newancestor	Wed May 19 20:20:12 2010 -0500
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+source $TESTDIR/helpers.sh
+
 echo "[extensions]" >> $HGRCPATH
 echo "graphlog=" >> $HGRCPATH
 echo "rebase=" >> $HGRCPATH
@@ -25,7 +27,7 @@
 hg commit -AmAD -u test -d '3 0'
 
 hg glog --template '{rev}:{desc} {node|short}\n'
-hg rebase -q -s 1 -d 3 2>&1 | grep -v 'saving bundle'
+hg rebase -q -s 1 -d 3 | hidebackup
 hg glog --template '{rev}:{desc} {node|short}\n'
 
 exit 0
--- a/tests/test-rebase-parameters	Wed May 19 19:46:39 2010 -0500
+++ b/tests/test-rebase-parameters	Wed May 19 20:20:12 2010 -0500
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+source $TESTDIR/helpers.sh
+
 echo "[extensions]" >> $HGRCPATH
 echo "rebase=" >> $HGRCPATH
 
@@ -62,7 +64,7 @@
 echo
 echo "% Rebase with no arguments (from 3 onto 7)"
 hg update -C 5
-hg rebase 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase 2>&1 | hidebackup
 
 echo "% Try to rollback after a rebase (fail)"
 hg rollback
@@ -71,38 +73,38 @@
 echo
 echo "% Rebase with base == '.' => same as no arguments (from 3 onto 7)"
 hg update -C 5
-hg rebase --base . 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase --base . | hidebackup
 
 createrepo > /dev/null 2>&1
 echo
 echo "% Rebase with dest == `hg branch` => same as no arguments (from 3 onto 7)"
 hg update -C 5
-hg rebase --dest `hg branch` 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase --dest `hg branch` | hidebackup
 
 createrepo > /dev/null 2>&1
 echo
 echo "% Specify only source (from 4 onto 7)"
-hg rebase --source 4 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase --source 4 | hidebackup
 
 createrepo > /dev/null 2>&1
 echo
 echo "% Specify only dest (from 3 onto 6)"
 hg update -C 5
-hg rebase --dest 6 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase --dest 6 | hidebackup
 
 createrepo > /dev/null 2>&1
 echo
 echo "% Specify only base (from 3 onto 7)"
-hg rebase --base 5 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase --base 5 | hidebackup
 
 createrepo > /dev/null 2>&1
 echo
 echo "% Specify source and dest (from 4 onto 6)"
-hg rebase --source 4 --dest 6 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase --source 4 --dest 6 | hidebackup
 
 createrepo > /dev/null 2>&1
 echo
 echo "% Specify base and dest (from 3 onto 6)"
-hg rebase --base 4 --dest 6 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase --base 4 --dest 6 | hidebackup
 
 exit 0
--- a/tests/test-rebase-pull	Wed May 19 19:46:39 2010 -0500
+++ b/tests/test-rebase-pull	Wed May 19 20:20:12 2010 -0500
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+source $TESTDIR/helpers.sh
+
 echo "[extensions]" >> $HGRCPATH
 echo "graphlog=" >> $HGRCPATH
 echo "rebase=" >> $HGRCPATH
@@ -34,14 +36,13 @@
 cd ../b
 echo
 echo "% Now b has one revision to be pulled from a"
-hg pull --rebase 2>&1 | sed -e 's/\(saving bundle to \).*/\1/' \
-                -e 's/\(pulling from \).*/\1/'
+hg pull --rebase | hidebackup | sed -e 's/\(pulling from \).*/\1/'
 
 hg glog --template '{rev}:{desc}\n'
 
 echo
 echo "% Re-run pull --rebase"
-hg pull --rebase 2>&1 | sed 's/\(pulling from \).*/\1/'
+hg pull --rebase | sed 's/\(pulling from \).*/\1/'
 
 echo
 echo "% Invoke pull --rebase and nothing to rebase"
--- a/tests/test-rebase-rename	Wed May 19 19:46:39 2010 -0500
+++ b/tests/test-rebase-rename	Wed May 19 20:20:12 2010 -0500
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+source $TESTDIR/helpers.sh
+
 echo "[extensions]" >> $HGRCPATH
 echo "rebase=" >> $HGRCPATH
 echo "[diff]" >> $HGRCPATH
@@ -7,12 +9,6 @@
 
 BASE=`pwd`
 
-cleanoutput () {
-    sed -e 's/\(Rebase status stored to\).*/\1/'  \
-        -e 's/\(Rebase status restored from\).*/\1/' \
-        -e 's/\(saving bundle to \).*/\1/'
-}
-
 hg init repo1
 cd repo1
 echo "a">a
@@ -28,7 +24,7 @@
 hg log -p -r tip --template '{rev}:{desc}\n'
 
 echo '% Rebase the revision containing the rename'
-hg rebase -s 2 -d 1 --quiet 2>&1 | cleanoutput
+hg rebase -s 2 -d 1 --quiet | cleanrebase
 
 echo
 echo '% Rename is not lost'
@@ -51,7 +47,7 @@
 hg log -p -r tip --template '{rev}:{desc}\n'
 
 echo '% Rebase the revision containing the copy'
-hg rebase -s 2 -d 1 --quiet 2>&1 | cleanoutput
+hg rebase -s 2 -d 1 --quiet | cleanrebase
 
 echo
 echo '% Copy is not lost'
--- a/tests/test-rebase-scenario-global	Wed May 19 19:46:39 2010 -0500
+++ b/tests/test-rebase-scenario-global	Wed May 19 20:20:12 2010 -0500
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+source $TESTDIR/helpers.sh
+
 echo "[extensions]" >> $HGRCPATH
 echo "graphlog=" >> $HGRCPATH
 echo "rebase=" >> $HGRCPATH
@@ -42,32 +44,32 @@
 
 echo '% Rebasing'
 echo '% B onto F - simple rebase'
-hg rebase -s 1 -d 5 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase -s 1 -d 5 | hidebackup
 hg glog  --template '{rev}: {desc}\n'
 
 createrepo > /dev/null 2>&1
 echo '% B onto D - intermediate point'
-hg rebase -s 1 -d 3 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase -s 1 -d 3 | hidebackup
 hg glog  --template '{rev}: {desc}\n'
 
 createrepo > /dev/null 2>&1
 echo '% C onto F - skip of E'
-hg rebase -s 2 -d 5 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase -s 2 -d 5 | hidebackup
 hg glog  --template '{rev}: {desc}\n'
 
 createrepo > /dev/null 2>&1
 echo '% D onto C - rebase of a branching point (skip E)'
-hg rebase -s 3 -d 2 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase -s 3 -d 2 | hidebackup
 hg glog  --template '{rev}: {desc}\n'
 
 createrepo > /dev/null 2>&1
 echo '% E onto F - merged revision having a parent in ancestors of target'
-hg rebase -s 4 -d 5 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase -s 4 -d 5 | hidebackup
 hg glog  --template '{rev}: {desc}\n'
 
 createrepo > /dev/null 2>&1
 echo '% D onto B - E maintains C as parent'
-hg rebase -s 3 -d 1 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg rebase -s 3 -d 1 | hidebackup
 hg glog  --template '{rev}: {desc}\n'
 
 echo '% These will fail (using --source)'