annotate tests/test-convert-svn-tags @ 6400:c237b27e1350

convert: allow tags detection to be disabled Tags calculation becomes more reliable but slower, measurable on frequent synchronizations.
author Patrick Mezard <pmezard@gmail.com>
date Sat, 29 Mar 2008 17:16:18 +0100
parents 5efd447a9b8d
children 6e4f7170734c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
0e91ef0b52e7 Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
34 svn import -m "init projA" projA $svnurl | fix_path
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
0e91ef0b52e7 Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
42 echo a >> trunk/a
0e91ef0b52e7 Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
43 svn ci -m changea
0e91ef0b52e7 Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
44 echo a >> trunk/a
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
5efd447a9b8d convert: follow svn tags history (issue953)
Patrick Mezard <pmezard@gmail.com>
parents: 6398
diff changeset
48 echo a >> unrelated/dummy
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"
6398
0e91ef0b52e7 Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
56 echo a >> trunk/a
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
c237b27e1350 convert: allow tags detection to be disabled
Patrick Mezard <pmezard@gmail.com>
parents: 6399
diff changeset
75 hg -R a-notags-hg tags -q
c237b27e1350 convert: allow tags detection to be disabled
Patrick Mezard <pmezard@gmail.com>
parents: 6399
diff changeset
76