Mercurial > hg
annotate tests/test-convert-svn-tags @ 7287:6e9fe4ff9c54
hgweb: handle subdirectories within static directory
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Tue, 28 Oct 2008 21:58:30 -0700 |
parents | 6ec941b6003d |
children | 90d8dfb481e7 |
rev | line source |
---|---|
6398
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
1 #!/bin/sh |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
2 |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
3 "$TESTDIR/hghave" svn svn-bindings || exit 80 |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
4 |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
5 fix_path() |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
6 { |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
7 tr '\\' / |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
8 } |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
9 |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
10 echo "[extensions]" >> $HGRCPATH |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
11 echo "convert = " >> $HGRCPATH |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
12 echo "hgext.graphlog =" >> $HGRCPATH |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
13 |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
14 svnadmin create svn-repo |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
15 |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
16 svnpath=`pwd | fix_path` |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
17 # SVN wants all paths to start with a slash. Unfortunately, |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
18 # Windows ones don't. Handle that. |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
19 expr $svnpath : "\/" > /dev/null |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
20 if [ $? -ne 0 ]; then |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
21 svnpath='/'$svnpath |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
22 fi |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
23 |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
24 echo % initial svn import |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
25 mkdir projA |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
26 cd projA |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
27 mkdir trunk |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
28 mkdir branches |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
29 mkdir tags |
6399
5efd447a9b8d
convert: follow svn tags history (issue953)
Patrick Mezard <pmezard@gmail.com>
parents:
6398
diff
changeset
|
30 mkdir unrelated |
6398
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
31 cd .. |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
32 |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
33 svnurl=file://$svnpath/svn-repo/projA |
6851
6ec941b6003d
Fix subversion tests with svn 1.5
Patrick Mezard <pmezard@gmail.com>
parents:
6439
diff
changeset
|
34 svn import -m "init projA" projA $svnurl | fix_path | sort |
6398
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
35 |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
36 echo % update svn repository |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
37 svn co $svnurl A | fix_path |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
38 cd A |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
39 echo a > trunk/a |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
40 svn add trunk/a |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
41 svn ci -m adda |
6439
c1b47c0fd2b6
convert: fix test-convert-svn-* problems with mtime not changing
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
6414
diff
changeset
|
42 "$TESTDIR/svn-safe-append.py" a trunk/a |
6398
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
43 svn ci -m changea |
6439
c1b47c0fd2b6
convert: fix test-convert-svn-* problems with mtime not changing
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
6414
diff
changeset
|
44 "$TESTDIR/svn-safe-append.py" a trunk/a |
6398
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
45 svn ci -m changea2 |
6399
5efd447a9b8d
convert: follow svn tags history (issue953)
Patrick Mezard <pmezard@gmail.com>
parents:
6398
diff
changeset
|
46 # Add an unrelated commit to test that tags are bound to the |
5efd447a9b8d
convert: follow svn tags history (issue953)
Patrick Mezard <pmezard@gmail.com>
parents:
6398
diff
changeset
|
47 # correct "from" revision and not a dummy one |
6439
c1b47c0fd2b6
convert: fix test-convert-svn-* problems with mtime not changing
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
6414
diff
changeset
|
48 "$TESTDIR/svn-safe-append.py" a unrelated/dummy |
6399
5efd447a9b8d
convert: follow svn tags history (issue953)
Patrick Mezard <pmezard@gmail.com>
parents:
6398
diff
changeset
|
49 svn add unrelated/dummy |
5efd447a9b8d
convert: follow svn tags history (issue953)
Patrick Mezard <pmezard@gmail.com>
parents:
6398
diff
changeset
|
50 svn ci -m unrelatedchange |
6398
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
51 echo % tag current revision |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
52 svn up |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
53 svn copy trunk tags/trunk.v1 |
6399
5efd447a9b8d
convert: follow svn tags history (issue953)
Patrick Mezard <pmezard@gmail.com>
parents:
6398
diff
changeset
|
54 svn copy trunk tags/trunk.badtag |
5efd447a9b8d
convert: follow svn tags history (issue953)
Patrick Mezard <pmezard@gmail.com>
parents:
6398
diff
changeset
|
55 svn ci -m "tagging trunk.v1 trunk.badtag" |
6439
c1b47c0fd2b6
convert: fix test-convert-svn-* problems with mtime not changing
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
6414
diff
changeset
|
56 "$TESTDIR/svn-safe-append.py" a trunk/a |
6398
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
57 svn ci -m changea3 |
6399
5efd447a9b8d
convert: follow svn tags history (issue953)
Patrick Mezard <pmezard@gmail.com>
parents:
6398
diff
changeset
|
58 echo % fix the bad tag |
5efd447a9b8d
convert: follow svn tags history (issue953)
Patrick Mezard <pmezard@gmail.com>
parents:
6398
diff
changeset
|
59 # trunk.badtag should not show in converted tags |
5efd447a9b8d
convert: follow svn tags history (issue953)
Patrick Mezard <pmezard@gmail.com>
parents:
6398
diff
changeset
|
60 svn up |
5efd447a9b8d
convert: follow svn tags history (issue953)
Patrick Mezard <pmezard@gmail.com>
parents:
6398
diff
changeset
|
61 svn mv tags/trunk.badtag tags/trunk.goodtag |
5efd447a9b8d
convert: follow svn tags history (issue953)
Patrick Mezard <pmezard@gmail.com>
parents:
6398
diff
changeset
|
62 svn ci -m "fix trunk.badtag" |
6398
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
63 cd .. |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
64 |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
65 echo % convert |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
66 hg convert --datesort $svnurl A-hg |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
67 |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
68 cd A-hg |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
69 hg glog --template '#rev# #desc|firstline# tags: #tags#\n' |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
70 hg tags -q |
0e91ef0b52e7
Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
71 cd .. |
6400
c237b27e1350
convert: allow tags detection to be disabled
Patrick Mezard <pmezard@gmail.com>
parents:
6399
diff
changeset
|
72 |
c237b27e1350
convert: allow tags detection to be disabled
Patrick Mezard <pmezard@gmail.com>
parents:
6399
diff
changeset
|
73 echo % convert without tags |
c237b27e1350
convert: allow tags detection to be disabled
Patrick Mezard <pmezard@gmail.com>
parents:
6399
diff
changeset
|
74 hg convert --datesort --config convert.svn.tags= $svnurl A-notags-hg |
6414
6e4f7170734c
Fix test-convert-svn-tags on case sensitive filesystems
Thomas Arendsen Hein <thomas@intevation.de>
parents:
6400
diff
changeset
|
75 hg -R A-notags-hg tags -q |
6400
c237b27e1350
convert: allow tags detection to be disabled
Patrick Mezard <pmezard@gmail.com>
parents:
6399
diff
changeset
|
76 |