annotate tests/test-convert-svn @ 5366:ff32b2725651

Merge with crew
author Matt Mackall <mpm@selenic.com>
date Wed, 03 Oct 2007 16:50:32 -0500
parents 4287590a63af
children d7d395fb7cd5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5255
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
1 #!/bin/sh
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
2
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
3 "$TESTDIR/hghave" svn svn-bindings || exit 80
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
4
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
5 fix_path()
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
6 {
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
7 tr '\\' /
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
8 }
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
9
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
10 echo "[extensions]" >> $HGRCPATH
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
11 echo "convert = " >> $HGRCPATH
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
12
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
13 svnadmin create svn-repo
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
14
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
15 echo % initial svn import
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
16 mkdir t
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
17 cd t
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
18 echo a > a
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
19 cd ..
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
20
5275
4287590a63af Fix \ inside ` problem in test-convert-svn (avoids code duplication, too)
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5255
diff changeset
21 svnpath=`pwd | fix_path`
5255
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
22 # SVN wants all paths to start with a slash. Unfortunately,
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
23 # Windows ones don't. Handle that.
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
24 expr $svnpath : "\/" > /dev/null
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
25 if [ $? -ne 0 ]; then
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
26 svnpath='/'$svnpath
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
27 fi
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
28
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
29 svnurl=file://$svnpath/svn-repo/trunk
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
30 svn import -m init t $svnurl | fix_path
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
31
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
32 echo % update svn repository
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
33 svn co $svnurl t2 | fix_path
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
34 cd t2
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
35 echo b >> a
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
36 echo b > b
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
37 svn add b
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
38 svn ci -m changea
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
39 cd ..
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
40
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
41 echo % convert to hg once
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
42 hg convert $svnurl
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
43
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
44 echo % update svn repository again
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
45 cd t2
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
46 echo c >> a
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
47 echo c >> b
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
48 svn ci -m changeb
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
49 cd ..
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
50
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
51 echo % test incremental conversion
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
52 hg convert $svnurl
37c610c41ed6 Test svn repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
53