Mercurial > hg
annotate tests/test-subrepo-svn @ 10855:62216faed067
templater: drop \ when handling escaped {
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 05 Apr 2010 15:25:08 -0500 |
parents | 48c8eb9de0c8 |
children | 33119d0252c1 |
rev | line source |
---|---|
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. |
10775
c52057614c72
Tests with spaces in paths
Mads Kiilerich <mads@kiilerich.com>
parents:
10457
diff
changeset
|
13 expr "$escapedwd" : "\/" > /dev/null |
10198
c2168d170f05
test-subrepo-svn: normalize OS specific path separator
Patrick Mezard <pmezard@gmail.com>
parents:
10196
diff
changeset
|
14 if [ $? -ne 0 ]; then |
10775
c52057614c72
Tests with spaces in paths
Mads Kiilerich <mads@kiilerich.com>
parents:
10457
diff
changeset
|
15 escapedwd="/$escapedwd" |
10198
c2168d170f05
test-subrepo-svn: normalize OS specific path separator
Patrick Mezard <pmezard@gmail.com>
parents:
10196
diff
changeset
|
16 fi |
10791
48c8eb9de0c8
test-subrepo-svn: properly escape the url, make it work for svn 1.5 again
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10775
diff
changeset
|
17 escapedwd=`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$escapedwd"` |
10775
c52057614c72
Tests with spaces in paths
Mads Kiilerich <mads@kiilerich.com>
parents:
10457
diff
changeset
|
18 filterpath="s|$escapedwd|/root|" |
10423
caaa1f99d681
test-subrepo-svn: handle svn output changes gracefully
Augie Fackler <durin42@gmail.com>
parents:
10273
diff
changeset
|
19 filtersvn='s/ in transaction.*/ is out of date/;s/Out of date: /File /' |
10178 | 20 |
21 echo % create subversion repo | |
22 | |
23 SVNREPO="file://$escapedwd/svn-repo" | |
10267
7e3a685be2f3
test-subrepo-svn: remove bashism
Mads Kiilerich <mads@kiilerich.com>
parents:
10198
diff
changeset
|
24 WCROOT="`pwd`/svn-wc" |
10178 | 25 svnadmin create svn-repo |
10775
c52057614c72
Tests with spaces in paths
Mads Kiilerich <mads@kiilerich.com>
parents:
10457
diff
changeset
|
26 svn co "$SVNREPO" svn-wc |
10178 | 27 cd svn-wc |
10273
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
28 mkdir src |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
29 echo alpha > src/alpha |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
30 svn add src |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
31 mkdir externals |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
32 echo other > externals/other |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
33 svn add externals |
10178 | 34 svn ci -m 'Add alpha' |
10273
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
35 svn up |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
36 cat > extdef <<EOF |
10791
48c8eb9de0c8
test-subrepo-svn: properly escape the url, make it work for svn 1.5 again
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10775
diff
changeset
|
37 externals -r1 $SVNREPO/externals |
10273
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
38 EOF |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
39 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
|
40 svn ci -m 'Setting externals' |
10178 | 41 cd .. |
42 | |
43 echo % create hg repo | |
44 mkdir sub | |
45 cd sub | |
46 hg init t | |
47 cd t | |
48 | |
49 echo % first revision, no sub | |
50 echo a > a | |
51 hg ci -Am0 | |
52 | |
10457
4f38d03d4975
subrepo: make sure that the source path is stripped
David Soria Parra <dsp@php.net>
parents:
10423
diff
changeset
|
53 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
|
54 echo "s = [svn] $SVNREPO/src" >> .hgsub |
10775
c52057614c72
Tests with spaces in paths
Mads Kiilerich <mads@kiilerich.com>
parents:
10457
diff
changeset
|
55 svn co --quiet "$SVNREPO"/src s |
10178 | 56 hg add .hgsub |
57 hg ci -m1 | |
58 echo % debugsub | |
10775
c52057614c72
Tests with spaces in paths
Mads Kiilerich <mads@kiilerich.com>
parents:
10457
diff
changeset
|
59 hg debugsub | sed "$filterpath" |
10178 | 60 |
61 echo | |
62 echo % change file in svn and hg, commit | |
63 echo a >> a | |
64 echo alpha >> s/alpha | |
65 hg commit -m 'Message!' | |
10775
c52057614c72
Tests with spaces in paths
Mads Kiilerich <mads@kiilerich.com>
parents:
10457
diff
changeset
|
66 hg debugsub | sed "$filterpath" |
10178 | 67 |
68 echo | |
69 echo a > s/a | |
70 echo % should be empty despite change to s/a | |
71 hg st | |
72 | |
73 echo | |
74 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
|
75 cd "$WCROOT"/src |
10178 | 76 svn up |
77 echo xyz >> alpha | |
10273
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
78 svn propset svn:mime-type 'text/xml' alpha |
10178 | 79 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
|
80 cd ../../sub/t |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
81 |
10178 | 82 echo % this commit from hg will fail |
83 echo zzz >> s/alpha | |
10423
caaa1f99d681
test-subrepo-svn: handle svn output changes gracefully
Augie Fackler <durin42@gmail.com>
parents:
10273
diff
changeset
|
84 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
|
85 svn revert -q s/alpha |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
86 |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
87 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
|
88 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
|
89 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
|
90 svn revert -q s/alpha |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
91 |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
92 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
|
93 echo zzz > s/externals/other |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
94 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
|
95 svn revert -q s/externals/other |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
96 |
e898bc7810ad
subrepo: handle svn externals and meta changes (issue1982)
Patrick Mezard <pmezard@gmail.com>
parents:
10267
diff
changeset
|
97 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
|
98 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
|
99 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
|
100 svn revert -q s/externals/other |
10178 | 101 |
102 echo | |
103 echo % clone | |
104 cd .. | |
10198
c2168d170f05
test-subrepo-svn: normalize OS specific path separator
Patrick Mezard <pmezard@gmail.com>
parents:
10196
diff
changeset
|
105 hg clone t tc | fix_path |
10178 | 106 cd tc |
107 echo % debugsub in clone | |
10775
c52057614c72
Tests with spaces in paths
Mads Kiilerich <mads@kiilerich.com>
parents:
10457
diff
changeset
|
108 hg debugsub | sed "$filterpath" |