##// END OF EJS Templates
test-convert-hg-svn: make it more windows friendly
Patrick Mezard -
r5809:34c4131a default
parent child Browse files
Show More
@@ -1,66 +1,73
1 1 #!/bin/sh
2 2
3 3 "$TESTDIR/hghave" svn svn-bindings || exit 80
4 4
5 5 fix_path()
6 6 {
7 7 tr '\\' /
8 8 }
9 9
10 10 echo "[extensions]" >> $HGRCPATH
11 11 echo "convert = " >> $HGRCPATH
12 12
13 svnpath=`pwd`/svn-repo
13 svnpath=`pwd | fix_path`/svn-repo
14 14 svnadmin create $svnpath
15 15
16 16 cat > $svnpath/hooks/pre-revprop-change <<'EOF'
17 17 #!/bin/sh
18 18
19 19 REPOS="$1"
20 20 REV="$2"
21 21 USER="$3"
22 22 PROPNAME="$4"
23 23 ACTION="$5"
24 24
25 25 if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi
26 26 if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-branch" ]; then exit 0; fi
27 27 if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-rev" ]; then exit 0; fi
28 28
29 29 echo "Changing prohibited revision property" >&2
30 30 exit 1
31 31 EOF
32 32 chmod +x $svnpath/hooks/pre-revprop-change
33 33
34 svnurl=file://$svnpath
34 # SVN wants all paths to start with a slash. Unfortunately,
35 # Windows ones don't. Handle that.
36 svnurl=$svnpath
37 expr $svnurl : "\/" > /dev/null
38 if [ $? -ne 0 ]; then
39 svnurl='/'$svnurl
40 fi
41 svnurl=file://$svnurl
35 42 svn co $svnurl $svnpath-wc
36 43
37 44 cd $svnpath-wc
38 45 echo a > a
39 46 svn add a
40 47 svn ci -m'added a' a
41 48
42 49 cd ..
43 50
44 51 echo % initial roundtrip
45 52 hg convert -s svn -d hg $svnpath-wc $svnpath-hg | grep -v initializing
46 53 hg convert -s hg -d svn $svnpath-hg $svnpath-wc
47 54
48 55 echo % second roundtrip should do nothing
49 56 hg convert -s svn -d hg $svnpath-wc $svnpath-hg
50 57 hg convert -s hg -d svn $svnpath-hg $svnpath-wc
51 58
52 59 echo % new hg rev
53 60
54 61 hg clone $svnpath-hg $svnpath-work
55 62 echo b > $svnpath-work/b
56 63 hg --cwd $svnpath-work add b
57 64 hg --cwd $svnpath-work ci -mb
58 65
59 66 echo % echo hg to svn
60 67 hg --cwd $svnpath-hg pull -q $svnpath-work
61 68 hg convert -s hg -d svn $svnpath-hg $svnpath-wc
62 69
63 70 echo % svn back to hg should do nothing
64 71 hg convert -s svn -d hg $svnpath-wc $svnpath-hg
65 72 echo % hg back to svn should do nothing
66 73 hg convert -s hg -d svn $svnpath-hg $svnpath-wc
General Comments 0
You need to be logged in to leave comments. Login now