[cig-commits] commit: test-forest: move path rewriting calls in a function

Mercurial hg at geodynamics.org
Mon Nov 24 11:27:17 PST 2008


changeset:   80:7403cc6df41c
user:        Patrick Mezard <pmezard at gmail.com>
date:        Wed Dec 26 15:38:56 2007 +0100
files:       test-forest
description:
test-forest: move path rewriting calls in a function


diff -r 1858f812ef71 -r 7403cc6df41c test-forest
--- a/test-forest	Fri Nov 30 15:44:12 2007 -0500
+++ b/test-forest	Wed Dec 26 15:38:56 2007 +0100
@@ -1,6 +1,11 @@
 #! /bin/sh
 
 #alias hg='hg --traceback'
+
+fixpath()
+{
+    sed -e "s@\(/private\)*$HGTMP at HGTMP@g"
+}
 
 HGRCPATH=$HGTMP/.hgrc
 export HGRCPATH
@@ -84,36 +89,36 @@ hg fseed -R newtop top-snap default
 hg fseed -R newtop top-snap default
 rm -rf newtop
 hg fseed --traceback --root newtop top-snap default >/dev/null
-hg fsnap --cwd newtop --compatible | sed "s@\(/private\)*$HGTMP at HGTMP@g"
-hg fsnap --cwd newtop | sed "s@\(/private\)*$HGTMP at HGTMP@g"
+hg fsnap --cwd newtop --compatible | fixpath
+hg fsnap --cwd newtop | fixpath
 rm -rf newtop
 
 echo "# fpull"
 hg fpull --cwd topcopy -u --snapfile=../top-snap default 2>&1 \
-    | sed "s@\(/private\)*$HGTMP at HGTMP@g"
+    | fixpath
 hg fpull --cwd topcopy -u ../top-snap default 2>&1 \
-    | sed "s@\(/private\)*$HGTMP at HGTMP@g"
+    | fixpath
 # Simulate a new repository
 rm -rf topcopy/t
 hg fpull -R topcopy -u 2>&1 \
-    | sed "s@\(/private\)*$HGTMP at HGTMP@g"
+    | fixpath
 
 echo "# foutgoing"
 echo "t/t/f" > topcopy/t/t/f
 hg commit --cwd topcopy/t/t -m "delete new line" -d "0 0"
 hg remove --cwd topcopy/d/d f2
 hg commit -R topcopy -m "remove new file" -d "0 0"
-hg foutgoing -R topcopy 2>&1 | sed "s@\(/private\)*$HGTMP at HGTMP@g"
-hg foutgoing --cwd topcopy default 2>&1 | sed "s@\(/private\)*$HGTMP at HGTMP@g"
-hg foutgoing -R topcopy foo 2>&1 | sed "s@\(/private\)*$HGTMP at HGTMP@g"
+hg foutgoing -R topcopy 2>&1 | fixpath
+hg foutgoing --cwd topcopy default 2>&1 | fixpath
+hg foutgoing -R topcopy foo 2>&1 | fixpath
 
 echo "# fincoming"
-hg fincoming -R toplevel topcopy 2>&1 | sed "s@\(/private\)*$HGTMP at HGTMP@g"
-hg fincoming --cwd toplevel ../topcopy 2>&1 | sed "s@\(/private\)*$HGTMP at HGTMP@g"
-hg fincoming -R toplevel foo 2>&1 | sed "s@\(/private\)*$HGTMP at HGTMP@g"
+hg fincoming -R toplevel topcopy 2>&1 | fixpath
+hg fincoming --cwd toplevel ../topcopy 2>&1 | fixpath
+hg fincoming -R toplevel foo 2>&1 | fixpath
 
 echo "# fpush"
-hg fpush -R topcopy top-snap default | sed "s@\(/private\)*$HGTMP at HGTMP@g"
+hg fpush -R topcopy top-snap default | fixpath
 
 echo "# fseed and fpull, missing section"
 cat top-snap | \
@@ -129,7 +134,7 @@ hg ftrees -R missing --convert
 hg ftrees -R missing --convert
 # pull (should find toplevel changesets)
 hg fpull -R missing top-snap-missing default 2>&1 \
-    | sed "s@\(/private\)*$HGTMP at HGTMP@g"
+    | fixpath
 rm -rf missing
 
 echo "# fseed and fpull, named section"
@@ -139,7 +144,7 @@ hg ftrees --cwd named --convert
 hg ftrees --cwd named --convert
 # pull (should find nothing)
 hg fpull --cwd named ../top-snap-named default 2>&1 \
-    | sed "s@\(/private\)*$HGTMP at HGTMP@g"
+    | fixpath
 rm -rf named
 
 # create an mq patch in topcopy/t
@@ -168,11 +173,11 @@ hg fsnap --cwd topcopy ../top-snap1
 
 echo "# fpull + mq"
 hg fpull --cwd topcopy -u ../top-snap default 2>&1 \
-    | sed "s@\(/private\)*$HGTMP at HGTMP@g"
+    | fixpath
 
 echo "# fpush + mq"
 hg fpush --cwd topcopy ../top-snap default 2>&1 \
-    | sed "s@\(/private\)*$HGTMP at HGTMP@g"
+    | fixpath
 
 echo "# fupdate + mq"
 hg fupdate --cwd topcopy
@@ -210,12 +215,12 @@ echo "b" >partial/b/f
 echo "b" >partial/b/f
 hg commit --cwd partial/a -A -m init -d "0 0"
 hg commit --cwd partial/b -A -m init -d "0 0"
-hg fclone partial partial-clone | sed "s@\(/private\)*$HGTMP at HGTMP@g"
+hg fclone partial partial-clone | fixpath
 rm -rf partial-clone/b
-hg --cwd partial-clone fpull --partial 2>&1 | sed "s@\(/private\)*$HGTMP at HGTMP@g"
+hg --cwd partial-clone fpull --partial 2>&1 | fixpath
 echo "[forest]" >> partial-clone/.hg/hgrc
 echo "partial = Yes" >> partial-clone/.hg/hgrc
-hg --cwd partial-clone fpull 2>&1 | sed "s@\(/private\)*$HGTMP at HGTMP@g"
+hg --cwd partial-clone fpull 2>&1 | fixpath
 echo "[forest]" >> partial-clone/.hg/hgrc
 echo "partial = No" >> partial-clone/.hg/hgrc
-hg --cwd partial-clone fpull 2>&1 | sed "s@\(/private\)*$HGTMP at HGTMP@g"
+hg --cwd partial-clone fpull 2>&1 | fixpath



More information about the CIG-COMMITS mailing list