test-repair-strip: Don't rely on cat error message
authorMads Kiilerich <mads@kiilerich.com>
Wed, 29 Jul 2009 22:14:46 +0200
changeset 9284 4a1b24dbf753
parent 9283 b3ee4c2e1ff5
child 9285 25255ce87bcf
child 9287 53fdf18fd63b
test-repair-strip: Don't rely on cat error message
tests/test-repair-strip
tests/test-repair-strip.out
--- a/tests/test-repair-strip	Sun Jul 05 13:59:25 2009 -0500
+++ b/tests/test-repair-strip	Wed Jul 29 22:14:46 2009 +0200
@@ -13,7 +13,11 @@
     chmod +$3 $4
     hg verify
     echo % journal contents
-    cat .hg/store/journal | sed 's/\.i[^\n]*/\.i/'
+    if [ -f .hg/store/journal ]; then
+        sed -e 's/\.i[^\n]*/\.i/' .hg/store/journal
+    else
+        echo "(no journal)"
+    fi
     ls .hg/store/journal >/dev/null 2>&1 && hg recover
     ls .hg/strip-backup/* >/dev/null 2>&1 && hg unbundle -q .hg/strip-backup/*
     rm -rf .hg/strip-backup
--- a/tests/test-repair-strip.out	Sun Jul 05 13:59:25 2009 -0500
+++ b/tests/test-repair-strip.out	Wed Jul 29 22:14:46 2009 +0200
@@ -46,7 +46,7 @@
 checking files
 3 files, 4 changesets, 4 total revisions
 % journal contents
-cat: .hg/store/journal: No such file or directory
+(no journal)
 % before update 0, strip 2
 changeset:   0:cb9a9f314b8b
 user:        test