annotate tests/test-convert-svn-branches @ 6491:2bdd43246c95

convert: check svn branches are directories
author Patrick Mezard <pmezard@gmail.com>
date Mon, 07 Apr 2008 11:59:20 +0200
parents c1b47c0fd2b6
children b6a24c273c30
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5874
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
1 #!/bin/sh
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
2
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
3 "$TESTDIR/hghave" svn svn-bindings || exit 80
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
4
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
5 fix_path()
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
6 {
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
7 tr '\\' /
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
8 }
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
9
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
10 echo "[extensions]" >> $HGRCPATH
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
11 echo "convert = " >> $HGRCPATH
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
12 echo "hgext.graphlog =" >> $HGRCPATH
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
13
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
14 svnadmin create svn-repo
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
15
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
16 svnpath=`pwd | fix_path`
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
17 # SVN wants all paths to start with a slash. Unfortunately,
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
18 # Windows ones don't. Handle that.
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
19 expr $svnpath : "\/" > /dev/null
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
20 if [ $? -ne 0 ]; then
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
21 svnpath='/'$svnpath
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
22 fi
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
23
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
24 echo % initial svn import
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
25 mkdir projA
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
26 cd projA
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
27 mkdir trunk
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
28 mkdir branches
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
29 mkdir tags
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
30 cd ..
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
31
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
32 svnurl=file://$svnpath/svn-repo/projA
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
33 svn import -m "init projA" projA $svnurl | fix_path
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
34
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
35 echo % update svn repository
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
36 svn co $svnurl A | fix_path
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
37 cd A
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
38 echo hello > trunk/letter.txt
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
39 echo hey > trunk/letter2.txt
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
40 echo ho > trunk/letter3.txt
6491
2bdd43246c95 convert: check svn branches are directories
Patrick Mezard <pmezard@gmail.com>
parents: 6439
diff changeset
41 # Add a file within branches, used to confuse branch detection
2bdd43246c95 convert: check svn branches are directories
Patrick Mezard <pmezard@gmail.com>
parents: 6439
diff changeset
42 echo a > branches/readme.txt
2bdd43246c95 convert: check svn branches are directories
Patrick Mezard <pmezard@gmail.com>
parents: 6439
diff changeset
43 svn add trunk/letter.txt trunk/letter2.txt trunk/letter3.txt branches/readme.txt
5874
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
44 svn ci -m hello
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
45
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
46 echo % branch to old letters
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
47 svn copy trunk branches/old
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
48 svn rm branches/old/letter3.txt
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
49 svn ci -m "branch trunk, remove letter3"
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
50 svn up
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
51
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
52 echo % update trunk
6439
c1b47c0fd2b6 convert: fix test-convert-svn-* problems with mtime not changing
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5874
diff changeset
53 "$TESTDIR/svn-safe-append.py" "what can I say ?" trunk/letter.txt
5874
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
54 svn ci -m "change letter"
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
55
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
56 echo % update old branch
6439
c1b47c0fd2b6 convert: fix test-convert-svn-* problems with mtime not changing
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5874
diff changeset
57 "$TESTDIR/svn-safe-append.py" "what's up ?" branches/old/letter2.txt
5874
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
58 svn ci -m "change letter2"
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
59
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
60 echo % create a cross-branch revision
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
61 svn move -m "move letter2" trunk/letter2.txt \
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
62 branches/old/letter3.txt
6439
c1b47c0fd2b6 convert: fix test-convert-svn-* problems with mtime not changing
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5874
diff changeset
63 "$TESTDIR/svn-safe-append.py" "I am fine" branches/old/letter3.txt
5874
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
64 svn ci -m "move and update letter3.txt"
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
65
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
66 echo % update old branch again
6439
c1b47c0fd2b6 convert: fix test-convert-svn-* problems with mtime not changing
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5874
diff changeset
67 "$TESTDIR/svn-safe-append.py" "bye" branches/old/letter2.txt
5874
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
68 svn ci -m "change letter2 again"
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
69
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
70 echo % update trunk again
6439
c1b47c0fd2b6 convert: fix test-convert-svn-* problems with mtime not changing
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5874
diff changeset
71 "$TESTDIR/svn-safe-append.py" "how are you ?" trunk/letter.txt
5874
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
72 svn ci -m "last change to letter"
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
73 cd ..
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
74
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
75 echo % convert trunk and branches
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
76 hg convert --datesort $svnurl A-hg
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
77
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
78 echo % branch again from a converted revision
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
79 cd A
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
80 svn copy -r 1 $svnurl/trunk branches/old2
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
81 svn ci -m "branch trunk@1 into old2"
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
82 cd ..
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
83
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
84 echo % convert again
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
85 hg convert --datesort $svnurl A-hg
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
86
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
87 cd A-hg
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
88 hg glog --template '#rev# #desc|firstline# files: #files#\n'
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
89 hg branches | sed 's/:.*/:/'
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
90 hg tags -q
866aa7ae2612 Test subversion branches conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
91 cd ..