author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
Fri, 19 Feb 2010 02:23:38 +0100 | |
branch | stable |
changeset 10510 | f77f3383c666 |
parent 10457 | 4f38d03d4975 |
child 10775 | c52057614c72 |
permissions | -rwxr-xr-x |
10178 | 1 |
#!/bin/sh |
2 |
||
3 |
"$TESTDIR/hghave" svn || exit 80 |
|
4 |
||
10198
c2168d170f05
test-subrepo-svn: normalize OS specific path separator
Patrick Mezard <pmezard@gmail.com>
parents:
10196
diff
changeset
|
5 |
fix_path() |
c2168d170f05
test-subrepo-svn: normalize OS specific path separator
Patrick Mezard <pmezard@gmail.com>
parents:
10196
diff
changeset
|
6 |
{ |
c2168d170f05
test-subrepo-svn: normalize OS specific path separator
Patrick Mezard <pmezard@gmail.com>
parents:
10196
diff
changeset
|
7 |
tr '\\' / |
c2168d170f05
test-subrepo-svn: normalize OS specific path separator
Patrick Mezard <pmezard@gmail.com>
parents:
10196
diff
changeset
|
8 |
} |
c2168d170f05
test-subrepo-svn: normalize OS specific path separator
Patrick Mezard <pmezard@gmail.com>
parents:
10196
diff
changeset
|
9 |
|
c2168d170f05
test-subrepo-svn: normalize OS specific path separator
Patrick Mezard <pmezard@gmail.com>
parents:
10196
diff
changeset
|
10 |
escapedwd=`pwd | fix_path` |
c2168d170f05
test-subrepo-svn: normalize OS specific path separator
Patrick Mezard <pmezard@gmail.com>
parents:
10196
diff
changeset
|
11 |
# SVN wants all paths to start with a slash. Unfortunately, |
c2168d170f05
test-subrepo-svn: normalize OS specific path separator
Patrick Mezard <pmezard@gmail.com>
parents:
10196
diff
changeset
|
12 |
# Windows ones don't. Handle that. |
c2168d170f05
test-subrepo-svn: normalize OS specific path separator
Patrick Mezard <pmezard@gmail.com>
parents:
10196
diff
changeset
|
13 |
expr $escapedwd : "\/" > /dev/null |
c2168d170f05
test-subrepo-svn: normalize OS specific path separator
Patrick Mezard <pmezard@gmail.com>
parents:
10196
diff
changeset
|
14 |
if [ $? -ne 0 ]; then |
c2168d170f05
test-subrepo-svn: normalize OS specific path separator
Patrick Mezard <pmezard@gmail.com>
parents:
10196
diff
changeset
|
15 |
escapedwd='/'$escapedwd |
c2168d170f05
test-subrepo-svn: normalize OS specific path separator
Patrick Mezard <pmezard@gmail.com>
parents:
10196
diff
changeset
|
16 |
fi |
c2168d170f05
test-subrepo-svn: normalize OS specific path separator
Patrick Mezard <pmezard@gmail.com>
parents:
10196
diff
changeset
|
17 |
filterpath="sed s|$escapedwd|/root|" |
10423
caaa1f99d681
test-subrepo-svn: handle svn output changes gracefully
Augie Fackler <durin42@gmail.com>
parents:
10273
diff
changeset
|
18 |
filtersvn='s/ in transaction.*/ is out of date/;s/Out of date: /File /' |
10178 | 19 |
|
20 |
echo % create subversion repo |
|
21 |
||
22 |
SVNREPO="file://$escapedwd/svn-repo" |
|
10267
7e3a685be2f3
test-subrepo-svn: remove bashism
Mads Kiilerich <mads@kiilerich.com>
parents:
10198
diff
changeset
|
23 |
WCROOT="`pwd`/svn-wc" |
10178 | 24 |
svnadmin create svn-repo |
25 |
svn co $SVNREPO svn-wc |
|
26 |
cd svn-wc |
|
10273
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
27 |
mkdir src |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
28 |
echo alpha > src/alpha |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
29 |
svn add src |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
30 |
mkdir externals |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
31 |
echo other > externals/other |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
32 |
svn add externals |
10178 | 33 |
svn ci -m 'Add alpha' |
10273
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
34 |
svn up |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
35 |
cat > extdef <<EOF |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
36 |
externals -r1 $SVNREPO/externals |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
37 |
EOF |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
38 |
svn propset -F extdef svn:externals src |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
39 |
svn ci -m 'Setting externals' |
10178 | 40 |
cd .. |
41 |
||
42 |
echo % create hg repo |
|
43 |
mkdir sub |
|
44 |
cd sub |
|
45 |
hg init t |
|
46 |
cd t |
|
47 |
||
48 |
echo % first revision, no sub |
|
49 |
echo a > a |
|
50 |
hg ci -Am0 |
|
51 |
||
10457
4f38d03d4975
subrepo: make sure that the source path is stripped
David Soria Parra <dsp@php.net>
parents:
10423
diff
changeset
|
52 |
echo % add first svn sub with leading whitespaces |
4f38d03d4975
subrepo: make sure that the source path is stripped
David Soria Parra <dsp@php.net>
parents:
10423
diff
changeset
|
53 |
echo "s = [svn] $SVNREPO/src" >> .hgsub |
10273
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
54 |
svn co --quiet $SVNREPO/src s |
10178 | 55 |
hg add .hgsub |
56 |
hg ci -m1 |
|
57 |
echo % debugsub |
|
58 |
hg debugsub | $filterpath |
|
59 |
||
60 |
echo |
|
61 |
echo % change file in svn and hg, commit |
|
62 |
echo a >> a |
|
63 |
echo alpha >> s/alpha |
|
64 |
hg commit -m 'Message!' |
|
65 |
hg debugsub | $filterpath |
|
66 |
||
67 |
echo |
|
68 |
echo a > s/a |
|
69 |
echo % should be empty despite change to s/a |
|
70 |
hg st |
|
71 |
||
72 |
echo |
|
73 |
echo % add a commit from svn |
|
10273
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
74 |
cd "$WCROOT"/src |
10178 | 75 |
svn up |
76 |
echo xyz >> alpha |
|
10273
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
77 |
svn propset svn:mime-type 'text/xml' alpha |
10178 | 78 |
svn ci -m 'amend a from svn' |
10273
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
79 |
cd ../../sub/t |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
80 |
|
10178 | 81 |
echo % this commit from hg will fail |
82 |
echo zzz >> s/alpha |
|
10423
caaa1f99d681
test-subrepo-svn: handle svn output changes gracefully
Augie Fackler <durin42@gmail.com>
parents:
10273
diff
changeset
|
83 |
hg ci -m 'amend alpha from hg' 2>&1 | sed "$filtersvn" |
10273
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
84 |
svn revert -q s/alpha |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
85 |
|
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
86 |
echo % this commit fails because of meta changes |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
87 |
svn propset svn:mime-type 'text/html' s/alpha |
10423
caaa1f99d681
test-subrepo-svn: handle svn output changes gracefully
Augie Fackler <durin42@gmail.com>
parents:
10273
diff
changeset
|
88 |
hg ci -m 'amend alpha from hg' 2>&1 | sed "$filtersvn" |
10273
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
89 |
svn revert -q s/alpha |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
90 |
|
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
91 |
echo % this commit fails because of externals changes |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
92 |
echo zzz > s/externals/other |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
93 |
hg ci -m 'amend externals from hg' |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
94 |
svn revert -q s/externals/other |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
95 |
|
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
96 |
echo % this commit fails because of externals meta changes |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
97 |
svn propset svn:mime-type 'text/html' s/externals/other |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
98 |
hg ci -m 'amend externals from hg' |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
99 |
svn revert -q s/externals/other |
10178 | 100 |
|
101 |
echo |
|
102 |
echo % clone |
|
103 |
cd .. |
|
10198
c2168d170f05
test-subrepo-svn: normalize OS specific path separator
Patrick Mezard <pmezard@gmail.com>
parents:
10196
diff
changeset
|
104 |
hg clone t tc | fix_path |
10178 | 105 |
cd tc |
106 |
echo % debugsub in clone |
|
107 |
hg debugsub | $filterpath |