##// END OF EJS Templates
test-share: handle sed/GNU-sed discrepancies
Patrick Mezard -
r10062:c204431b default
parent child Browse files
Show More
@@ -1,42 +1,43 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 echo "[extensions]" >> $HGRCPATH
3 echo "[extensions]" >> $HGRCPATH
4 echo "share = " >> $HGRCPATH
4 echo "share = " >> $HGRCPATH
5
5
6 echo % prepare repo1
6 echo % prepare repo1
7 hg init repo1
7 hg init repo1
8 cd repo1
8 cd repo1
9 echo a > a
9 echo a > a
10 hg commit -A -m'init'
10 hg commit -A -m'init'
11
11
12 echo % share it
12 echo % share it
13 cd ..
13 cd ..
14 hg share repo1 repo2
14 hg share repo1 repo2
15
15
16 echo % contents of repo2/.hg
16 echo % contents of repo2/.hg
17 cd repo2
17 cd repo2
18 [ -d .hg/store ] \
18 [ -d .hg/store ] \
19 && echo "fail: .hg/store should not exist" \
19 && echo "fail: .hg/store should not exist" \
20 || echo "pass: .hg/store does not exist"
20 || echo "pass: .hg/store does not exist"
21 cat .hg/sharedpath | sed "s:$HGTMP:*HGTMP*:"; echo
21 # sed appends a newline to the stream if none, GNU sed does not
22 sed "s:$HGTMP:*HGTMP*:" .hg/sharedpath | tr -d '\n'; echo
22
23
23 echo % commit in shared clone
24 echo % commit in shared clone
24 echo a >> a
25 echo a >> a
25 hg commit -m'change in shared clone'
26 hg commit -m'change in shared clone'
26
27
27 echo % check original
28 echo % check original
28 cd ../repo1
29 cd ../repo1
29 hg log
30 hg log
30 hg update
31 hg update
31 cat a # should be two lines of "a"
32 cat a # should be two lines of "a"
32
33
33 echo % commit in original
34 echo % commit in original
34 echo b > b
35 echo b > b
35 hg commit -A -m'another file'
36 hg commit -A -m'another file'
36
37
37 echo % check in shared clone
38 echo % check in shared clone
38 cd ../repo2
39 cd ../repo2
39 hg log
40 hg log
40 hg update
41 hg update
41 cat b # should exist with one "b"
42 cat b # should exist with one "b"
42
43
General Comments 0
You need to be logged in to leave comments. Login now