test-rebase-mq: '|' is a GNU sed extension, unfold it
authorPatrick Mezard <pmezard@gmail.com>
Sun, 24 Aug 2008 19:24:47 +0200
changeset 6931 02f4a0bcfdce
parent 6930 a58a611c320f
child 6932 d557749c627a
test-rebase-mq: '|' is a GNU sed extension, unfold it
tests/test-rebase-mq
--- a/tests/test-rebase-mq	Thu Aug 21 19:05:18 2008 +0200
+++ b/tests/test-rebase-mq	Sun Aug 24 19:24:47 2008 +0200
@@ -5,6 +5,16 @@
 echo "rebase=" >> $HGRCPATH
 echo "mq=" >> $HGRCPATH
 
+filterpatch()
+{
+    sed -e "s/^\(# Date\).*/\1/" \
+        -e "s/^\(# Node ID\).*/\1/" \
+        -e "s/^\(# Parent\).*/\1/" \
+        -e "s/^\(diff -r \)\([a-f0-9]* \)\(-r \)\([a-f0-9]* \)/\1x \3y /" \
+        -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" \
+        -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/"
+}
+
 hg init a
 cd a
 hg qinit -c # This must work even with a managed mq queue
@@ -54,9 +64,7 @@
 echo '% f correctly reflects the merge result'
 cat f
 echo '% And the patch is correct'
-cat .hg/patches/f.patch | sed -e "s/^\(# \(Date\|Node ID\|Parent\)\).*/\1/" \
-        -e  "s/^\(diff -r \)\([a-f0-9]* \)\(-r \)\([a-f0-9]* \)/\1x \3y /" \
-        -e  "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/"
+cat .hg/patches/f.patch | filterpatch
 
 echo
 echo '% Update to qtip'
@@ -64,6 +72,5 @@
 echo '% f correctly reflects the merge result'
 cat f
 echo '% And the patch is correct'
-cat .hg/patches/f2.patch | sed -e "s/^\(# \(Date\|Node ID\|Parent\)\).*/\1/" \
-        -e  "s/^\(diff -r \)\([a-f0-9]* \)\(-r \)\([a-f0-9]* \)/\1x \3y /" \
-        -e  "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/"
+cat .hg/patches/f2.patch | filterpatch
+