changeset 27993:afb86ee925bf

tests: dump journal file by python script instead of sed for portability Before this patch, test-repair-strip.t fails on Solaris, because of "sed" on it doesn't work as expected if input contains null ('\0') character.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Fri, 05 Feb 2016 22:32:05 +0900
parents 8f244b75cc5e
children 90cff855ae1c
files tests/test-repair-strip.t
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-repair-strip.t	Fri Feb 05 22:32:05 2016 +0900
+++ b/tests/test-repair-strip.t	Fri Feb 05 22:32:05 2016 +0900
@@ -1,5 +1,12 @@
 #require unix-permissions no-root
 
+  $ cat > $TESTTMP/dumpjournal.py <<EOF
+  > import sys
+  > for entry in sys.stdin.read().split('\n'):
+  >     if entry:
+  >         print entry.split('\x00')[0]
+  > EOF
+
   $ echo "[extensions]" >> $HGRCPATH
   $ echo "mq=">> $HGRCPATH
 
@@ -14,7 +21,7 @@
   >   hg verify
   >   echo % journal contents
   >   if [ -f .hg/store/journal ]; then
-  >       sed -e 's/\.i[^\n]*/\.i/' .hg/store/journal
+  >       cat .hg/store/journal | python $TESTTMP/dumpjournal.py
   >   else
   >       echo "(no journal)"
   >   fi