Mercurial > hg
comparison tests/test-subrepo-svn @ 10775:c52057614c72 stable
Tests with spaces in paths
This allows most tests to succeed with
./run-tests.py --tmpdir='/tmp/hg test'
and introduces other tests for spaces and shell quoting
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Wed, 24 Mar 2010 01:43:24 +0100 |
parents | 4f38d03d4975 |
children | 48c8eb9de0c8 |
comparison
equal
deleted
inserted
replaced
10772:1e819576e926 | 10775:c52057614c72 |
---|---|
8 } | 8 } |
9 | 9 |
10 escapedwd=`pwd | fix_path` | 10 escapedwd=`pwd | fix_path` |
11 # SVN wants all paths to start with a slash. Unfortunately, | 11 # SVN wants all paths to start with a slash. Unfortunately, |
12 # Windows ones don't. Handle that. | 12 # Windows ones don't. Handle that. |
13 expr $escapedwd : "\/" > /dev/null | 13 expr "$escapedwd" : "\/" > /dev/null |
14 if [ $? -ne 0 ]; then | 14 if [ $? -ne 0 ]; then |
15 escapedwd='/'$escapedwd | 15 escapedwd="/$escapedwd" |
16 fi | 16 fi |
17 filterpath="sed s|$escapedwd|/root|" | 17 filterpath="s|$escapedwd|/root|" |
18 filtersvn='s/ in transaction.*/ is out of date/;s/Out of date: /File /' | 18 filtersvn='s/ in transaction.*/ is out of date/;s/Out of date: /File /' |
19 | 19 |
20 echo % create subversion repo | 20 echo % create subversion repo |
21 | 21 |
22 SVNREPO="file://$escapedwd/svn-repo" | 22 SVNREPO="file://$escapedwd/svn-repo" |
23 WCROOT="`pwd`/svn-wc" | 23 WCROOT="`pwd`/svn-wc" |
24 svnadmin create svn-repo | 24 svnadmin create svn-repo |
25 svn co $SVNREPO svn-wc | 25 svn co "$SVNREPO" svn-wc |
26 cd svn-wc | 26 cd svn-wc |
27 mkdir src | 27 mkdir src |
28 echo alpha > src/alpha | 28 echo alpha > src/alpha |
29 svn add src | 29 svn add src |
30 mkdir externals | 30 mkdir externals |
31 echo other > externals/other | 31 echo other > externals/other |
32 svn add externals | 32 svn add externals |
33 svn ci -m 'Add alpha' | 33 svn ci -m 'Add alpha' |
34 svn up | 34 svn up |
35 cat > extdef <<EOF | 35 cat > extdef <<EOF |
36 externals -r1 $SVNREPO/externals | 36 externals -r1 "$SVNREPO/externals" |
37 EOF | 37 EOF |
38 svn propset -F extdef svn:externals src | 38 svn propset -F extdef svn:externals src |
39 svn ci -m 'Setting externals' | 39 svn ci -m 'Setting externals' |
40 cd .. | 40 cd .. |
41 | 41 |
49 echo a > a | 49 echo a > a |
50 hg ci -Am0 | 50 hg ci -Am0 |
51 | 51 |
52 echo % add first svn sub with leading whitespaces | 52 echo % add first svn sub with leading whitespaces |
53 echo "s = [svn] $SVNREPO/src" >> .hgsub | 53 echo "s = [svn] $SVNREPO/src" >> .hgsub |
54 svn co --quiet $SVNREPO/src s | 54 svn co --quiet "$SVNREPO"/src s |
55 hg add .hgsub | 55 hg add .hgsub |
56 hg ci -m1 | 56 hg ci -m1 |
57 echo % debugsub | 57 echo % debugsub |
58 hg debugsub | $filterpath | 58 hg debugsub | sed "$filterpath" |
59 | 59 |
60 echo | 60 echo |
61 echo % change file in svn and hg, commit | 61 echo % change file in svn and hg, commit |
62 echo a >> a | 62 echo a >> a |
63 echo alpha >> s/alpha | 63 echo alpha >> s/alpha |
64 hg commit -m 'Message!' | 64 hg commit -m 'Message!' |
65 hg debugsub | $filterpath | 65 hg debugsub | sed "$filterpath" |
66 | 66 |
67 echo | 67 echo |
68 echo a > s/a | 68 echo a > s/a |
69 echo % should be empty despite change to s/a | 69 echo % should be empty despite change to s/a |
70 hg st | 70 hg st |
102 echo % clone | 102 echo % clone |
103 cd .. | 103 cd .. |
104 hg clone t tc | fix_path | 104 hg clone t tc | fix_path |
105 cd tc | 105 cd tc |
106 echo % debugsub in clone | 106 echo % debugsub in clone |
107 hg debugsub | $filterpath | 107 hg debugsub | sed "$filterpath" |