strip: improve full backup message
authorMatt Mackall <mpm@selenic.com>
Thu, 20 May 2010 12:15:44 -0500
changeset 11200 12e5149cafca
parent 11199 4b1f4e473c17
child 11201 34023f2ca305
strip: improve full backup message
mercurial/repair.py
tests/helpers.sh
tests/test-bookmarks-strip
tests/test-bookmarks-strip.out
tests/test-mq
tests/test-mq-strip
tests/test-mq-strip.out
tests/test-mq.out
tests/test-repair-strip.out
tests/test-strip-cross
tests/test-strip-cross.out
--- a/mercurial/repair.py	Wed May 19 20:20:16 2010 -0500
+++ b/mercurial/repair.py	Thu May 20 12:15:44 2010 -0500
@@ -108,7 +108,7 @@
     backupfile = None
     if backup == "all":
         backupfile = _bundle(repo, [node], cl.heads(), node, 'backup')
-        repo.ui.status(_("saving bundle to %s\n") % backupfile)
+        repo.ui.status(_("saved backup bundle to %s\n") % backupfile)
     if saveheads or extranodes:
         chgrpfile = _bundle(repo, savebases, saveheads, node, 'temp',
                             extranodes)
--- a/tests/helpers.sh	Wed May 19 20:20:16 2010 -0500
+++ b/tests/helpers.sh	Thu May 20 12:15:44 2010 -0500
@@ -8,10 +8,10 @@
 
 hidetmp() { sed "s/$HGTMP/\$HGTMP/"; }
 
-hidebackup() { sed 's/\(saving bundle to \).*/\1/'; }
+hidebackup() { sed 's/\(saved backup bundle to \).*/\1/'; }
 
 cleanrebase() {
     sed -e 's/\(Rebase status stored to\).*/\1/'  \
         -e 's/\(Rebase status restored from\).*/\1/' \
-        -e 's/\(saving bundle to \).*/\1/';
+        -e 's/\(saved backup bundle to \).*/\1/';
 }
--- a/tests/test-bookmarks-strip	Wed May 19 20:20:16 2010 -0500
+++ b/tests/test-bookmarks-strip	Thu May 20 12:15:44 2010 -0500
@@ -1,5 +1,6 @@
 #!/bin/sh
 
+source $TESTDIR/helpers.sh
 echo "[extensions]" >> $HGRCPATH
 echo "bookmarks=" >> $HGRCPATH
 echo "mq=" >> $HGRCPATH
@@ -37,7 +38,7 @@
 hg book
 
 echo % strip to revision 1
-hg strip 1 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg strip 1 | hidebackup
 
 echo % list bookmarks
 hg book
--- a/tests/test-bookmarks-strip.out	Wed May 19 20:20:16 2010 -0500
+++ b/tests/test-bookmarks-strip.out	Thu May 20 12:15:44 2010 -0500
@@ -12,7 +12,7 @@
    test                      1:16b24da7e457
    test2                     1:16b24da7e457
 % strip to revision 1
-saving bundle to 
+saved backup bundle to 
 adding branch
 adding changesets
 adding manifests
--- a/tests/test-mq	Wed May 19 20:20:16 2010 -0500
+++ b/tests/test-mq	Thu May 20 12:15:44 2010 -0500
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+source $TESTDIR/helpers.sh
+
 checkundo()
 {
     if [ -f .hg/store/undo ]; then
@@ -318,16 +320,16 @@
 cd ../../b
 echo x>x
 hg ci -Ama
-hg strip tip 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg strip tip | hidebackup
 hg unbundle .hg/strip-backup/*
 
 echo % strip with local changes, should complain
 hg up
 echo y>y
 hg add y
-hg strip tip | sed 's/\(saving bundle to \).*/\1/'
+hg strip tip | hidebackup
 echo % --force strip with local changes
-hg strip -f tip 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg strip -f tip | hidebackup
 
 echo '% cd b; hg qrefresh'
 hg init refresh
@@ -502,7 +504,7 @@
 HGMERGE=true hg merge
 hg ci -m merge
 hg log
-hg strip 1 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg strip 1 | hidebackup
 checkundo strip
 hg log
 cd ..
--- a/tests/test-mq-strip	Wed May 19 20:20:16 2010 -0500
+++ b/tests/test-mq-strip	Thu May 20 12:15:44 2010 -0500
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+source $TESTDIR/helpers.sh
+
 echo "[extensions]" >> $HGRCPATH
 echo "mq=" >> $HGRCPATH
 
@@ -7,7 +9,7 @@
     hg up -C $1
     echo % before update $1, strip $2
     hg parents
-    hg strip $2 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+    hg strip $2 | hidebackup
     echo % after update $1, strip $2
     hg parents
     hg unbundle -q .hg/strip-backup/*
@@ -48,6 +50,6 @@
 hg merge 4
 echo % before strip of merge parent
 hg parents
-hg strip 4 2>&1 | sed 's/\(saving bundle to \).*/\1/'
+hg strip 4 2>&1 | hidebackup
 echo % after strip of merge parent
 hg parents
--- a/tests/test-mq-strip.out	Wed May 19 20:20:16 2010 -0500
+++ b/tests/test-mq-strip.out	Thu May 20 12:15:44 2010 -0500
@@ -37,7 +37,7 @@
 summary:     e
 
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-saving bundle to 
+saved backup bundle to 
 % after update 4, strip 4
 changeset:   3:65bd5f99a4a3
 tag:         tip
@@ -55,7 +55,7 @@
 summary:     e
 
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-saving bundle to 
+saved backup bundle to 
 % after update 4, strip 3
 changeset:   1:ef3a871183d7
 user:        test
@@ -69,7 +69,7 @@
 date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     b
 
-saving bundle to 
+saved backup bundle to 
 % after update 1, strip 4
 changeset:   1:ef3a871183d7
 user:        test
@@ -84,7 +84,7 @@
 date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     e
 
-saving bundle to 
+saved backup bundle to 
 adding branch
 adding changesets
 adding manifests
@@ -107,7 +107,7 @@
 summary:     c
 
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-saving bundle to 
+saved backup bundle to 
 % after update 4, strip 1
 changeset:   0:9ab35a2d17cb
 tag:         tip
@@ -117,7 +117,7 @@
 
 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
 % before update null, strip 4
-saving bundle to 
+saved backup bundle to 
 % after update null, strip 4
 changeset:   4:264128213d29
 tag:         tip
@@ -163,7 +163,7 @@
 summary:     c
 
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-saving bundle to 
+saved backup bundle to 
 % after strip of merge parent
 changeset:   1:ef3a871183d7
 user:        test
--- a/tests/test-mq.out	Wed May 19 20:20:16 2010 -0500
+++ b/tests/test-mq.out	Thu May 20 12:15:44 2010 -0500
@@ -334,7 +334,7 @@
 % strip
 adding x
 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-saving bundle to 
+saved backup bundle to 
 adding changesets
 adding manifests
 adding file changes
@@ -345,7 +345,7 @@
 abort: local changes found
 % --force strip with local changes
 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-saving bundle to 
+saved backup bundle to 
 % cd b; hg qrefresh
 adding a
 foo
@@ -529,7 +529,7 @@
 summary:     add foo
 
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-saving bundle to 
+saved backup bundle to 
 adding branch
 adding changesets
 adding manifests
--- a/tests/test-repair-strip.out	Wed May 19 20:20:16 2010 -0500
+++ b/tests/test-repair-strip.out	Thu May 20 12:15:44 2010 -0500
@@ -4,7 +4,7 @@
 date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     a
 
-saving bundle
+saved backup bundle
 transaction abort!
 failed to truncate data/b.i
 rollback failed - please run hg recover
@@ -55,7 +55,7 @@
 date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     a
 
-saving bundle
+saved backup bundle
 transaction abort!
 failed to truncate 00manifest.i
 rollback failed - please run hg recover
--- a/tests/test-strip-cross	Wed May 19 20:20:16 2010 -0500
+++ b/tests/test-strip-cross	Thu May 20 12:15:44 2010 -0500
@@ -2,17 +2,13 @@
 
 # test stripping of filelogs where the linkrev doesn't always increase
 
+source $TESTDIR/helpers.sh
 echo '[extensions]' >> $HGRCPATH
 echo 'hgext.mq =' >> $HGRCPATH
 
 hg init orig
 cd orig
 
-hidefilename()
-{
-    sed -e 's/saving bundle to .*strip-backup/saving bundle to strip-backup/'
-}
-
 commit()
 {
     hg up -qC null
@@ -60,7 +56,7 @@
 for i in 0 1 2 3 4; do
     hg clone -q -U --pull crossed $i
     echo "% Trying to strip revision $i"
-    hg --cwd $i strip $i 2>&1 | hidefilename
+    hg --cwd $i strip $i | hidebackup
     echo "% Verifying"
     hg --cwd $i verify
     echo
--- a/tests/test-strip-cross.out	Wed May 19 20:20:16 2010 -0500
+++ b/tests/test-strip-cross.out	Thu May 20 12:15:44 2010 -0500
@@ -48,7 +48,7 @@
      1         3       3      1       4 5d9299349fc0 000000000000 000000000000
 
 % Trying to strip revision 0
-saving bundle to strip-backup/cbb8c2f0a2e3-backup
+saved backup bundle to 
 adding branch
 adding changesets
 adding manifests
@@ -62,7 +62,7 @@
 7 files, 4 changesets, 15 total revisions
 
 % Trying to strip revision 1
-saving bundle to strip-backup/124ecc0cbec9-backup
+saved backup bundle to 
 adding branch
 adding changesets
 adding manifests
@@ -76,7 +76,7 @@
 7 files, 4 changesets, 14 total revisions
 
 % Trying to strip revision 2
-saving bundle to strip-backup/f6439b304a1a-backup
+saved backup bundle to 
 adding branch
 adding changesets
 adding manifests
@@ -90,7 +90,7 @@
 7 files, 4 changesets, 14 total revisions
 
 % Trying to strip revision 3
-saving bundle to strip-backup/6e54ec5db740-backup
+saved backup bundle to 
 adding branch
 adding changesets
 adding manifests
@@ -104,7 +104,7 @@
 7 files, 4 changesets, 19 total revisions
 
 % Trying to strip revision 4
-saving bundle to strip-backup/9147ea23c156-backup
+saved backup bundle to 
 % Verifying
 checking changesets
 checking manifests