Skip to content
Snippets Groups Projects
Commit 2250fc37 authored by Patrick Mezard's avatar Patrick Mezard
Browse files

Fix test-share and test-subrepo under Windows

parent 16c68fd7
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
#
# This used to be a simple sed call like:
#
# $ sed "s:$HGTMP:*HGTMP*:"
#
# But $HGTMP has ':' under Windows which breaks the sed call.
#
import sys, os
input = sys.stdin.read()
input = input.replace(os.environ['HGTMP'], '$HGTMP')
input = input.replace(os.sep, '/')
sys.stdout.write(input)
......@@ -19,7 +19,7 @@
&& echo "fail: .hg/store should not exist" \
|| echo "pass: .hg/store does not exist"
# Some sed versions appends newline, some don't, and some just fails
(cat .hg/sharedpath; echo) | head -n1 | sed "s:$HGTMP:*HGTMP*:"
(cat .hg/sharedpath; echo) | head -n1 | "$TESTDIR/filtertmp.py"
echo % commit in shared clone
echo a >> a
......
......@@ -5,7 +5,7 @@
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
% contents of repo2/.hg
pass: .hg/store does not exist
*HGTMP*/test-share/repo1/.hg
$HGTMP/test-share/repo1/.hg
% commit in shared clone
% check original
changeset: 1:8af4dc49db9e
......
......@@ -180,7 +180,9 @@
hg -R main ci -m "add subrepos"
cd ..
hg clone mercurial/main mercurial2/main
cat mercurial2/main/nested_absolute/.hg/hgrc mercurial2/main/nested_relative/.hg/hgrc | sed "s:${PWD}:/tmp:"
cat mercurial2/main/nested_absolute/.hg/hgrc \
mercurial2/main/nested_relative/.hg/hgrc \
| "$TESTDIR/filtertmp.py"
rm -rf mercurial mercurial2
exit 0
......@@ -256,5 +256,5 @@
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
[paths]
default = /tmp/mercurial/main/nested_absolute
default = $HGTMP/test-subrepo/sub/mercurial/main/nested_absolute
[paths]
......@@ -260,2 +260,2 @@
[paths]
default = /tmp/mercurial/main/nested_relative
default = $HGTMP/test-subrepo/sub/mercurial/main/nested_relative
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment