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