##// END OF EJS Templates
test-subrepo-svn: avoid pushd/popd
Patrick Mezard -
r10196:20d84925 default
parent child Browse files
Show More
@@ -1,72 +1,70 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 "$TESTDIR/hghave" svn || exit 80
3 "$TESTDIR/hghave" svn || exit 80
4
4
5 escapedwd=$(pwd | \
5 escapedwd=$(pwd | \
6 python -c \
6 python -c \
7 "import sys,urllib; print urllib.pathname2url(sys.stdin.read().strip())"
7 "import sys,urllib; print urllib.pathname2url(sys.stdin.read().strip())"
8 )
8 )
9 filterpath="sed s+$escapedwd+/root+"
9 filterpath="sed s+$escapedwd+/root+"
10
10
11 echo % create subversion repo
11 echo % create subversion repo
12
12
13 SVNREPO="file://$escapedwd/svn-repo"
13 SVNREPO="file://$escapedwd/svn-repo"
14 WCROOT="$(pwd)/svn-wc"
14 WCROOT="$(pwd)/svn-wc"
15 svnadmin create svn-repo
15 svnadmin create svn-repo
16 svn co $SVNREPO svn-wc
16 svn co $SVNREPO svn-wc
17 cd svn-wc
17 cd svn-wc
18 echo alpha > alpha
18 echo alpha > alpha
19 svn add alpha
19 svn add alpha
20 svn ci -m 'Add alpha'
20 svn ci -m 'Add alpha'
21 cd ..
21 cd ..
22
22
23 echo % create hg repo
23 echo % create hg repo
24
25 rm -rf sub
26 mkdir sub
24 mkdir sub
27 cd sub
25 cd sub
28 hg init t
26 hg init t
29 cd t
27 cd t
30
28
31 echo % first revision, no sub
29 echo % first revision, no sub
32 echo a > a
30 echo a > a
33 hg ci -Am0
31 hg ci -Am0
34
32
35 echo % add first svn sub
33 echo % add first svn sub
36 echo "s = [svn]$SVNREPO" >> .hgsub
34 echo "s = [svn]$SVNREPO" >> .hgsub
37 svn co --quiet $SVNREPO s
35 svn co --quiet $SVNREPO s
38 hg add .hgsub
36 hg add .hgsub
39 hg ci -m1
37 hg ci -m1
40 echo % debugsub
38 echo % debugsub
41 hg debugsub | $filterpath
39 hg debugsub | $filterpath
42
40
43 echo
41 echo
44 echo % change file in svn and hg, commit
42 echo % change file in svn and hg, commit
45 echo a >> a
43 echo a >> a
46 echo alpha >> s/alpha
44 echo alpha >> s/alpha
47 hg commit -m 'Message!'
45 hg commit -m 'Message!'
48 hg debugsub | $filterpath
46 hg debugsub | $filterpath
49
47
50 echo
48 echo
51 echo a > s/a
49 echo a > s/a
52 echo % should be empty despite change to s/a
50 echo % should be empty despite change to s/a
53 hg st
51 hg st
54
52
55 echo
53 echo
56 echo % add a commit from svn
54 echo % add a commit from svn
57 pushd "$WCROOT" > /dev/null
55 cd "$WCROOT"
58 svn up
56 svn up
59 echo xyz >> alpha
57 echo xyz >> alpha
60 svn ci -m 'amend a from svn'
58 svn ci -m 'amend a from svn'
61 popd > /dev/null
59 cd ../sub/t
62 echo % this commit from hg will fail
60 echo % this commit from hg will fail
63 echo zzz >> s/alpha
61 echo zzz >> s/alpha
64 hg ci -m 'amend alpha from hg'
62 hg ci -m 'amend alpha from hg'
65
63
66 echo
64 echo
67 echo % clone
65 echo % clone
68 cd ..
66 cd ..
69 hg clone t tc
67 hg clone t tc
70 cd tc
68 cd tc
71 echo % debugsub in clone
69 echo % debugsub in clone
72 hg debugsub | $filterpath
70 hg debugsub | $filterpath
General Comments 0
You need to be logged in to leave comments. Login now