annotate tests/test-convert-svn-tags @ 8209:a1a5a57efe90

replace util.sort with sorted built-in This is marginally faster for small and moderately-sized lists
author Matt Mackall <mpm@selenic.com>
date Sun, 26 Apr 2009 16:50:44 -0500
parents 90d8dfb481e7
children 965b11c1bd82
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
7475
90d8dfb481e7 Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents: 6851
diff changeset
15 cat "$TESTDIR/svn/tags.svndump" | svnadmin load svn-repo > /dev/null
6398
0e91ef0b52e7 Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
16
0e91ef0b52e7 Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
17 svnpath=`pwd | fix_path`
0e91ef0b52e7 Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
18 # 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
19 # Windows ones don't. Handle that.
0e91ef0b52e7 Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
20 expr $svnpath : "\/" > /dev/null
0e91ef0b52e7 Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
21 if [ $? -ne 0 ]; then
0e91ef0b52e7 Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
22 svnpath='/'$svnpath
0e91ef0b52e7 Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
23 fi
7475
90d8dfb481e7 Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents: 6851
diff changeset
24 svnurl=file://$svnpath/svn-repo
6398
0e91ef0b52e7 Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
25
0e91ef0b52e7 Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
26 echo % convert
0e91ef0b52e7 Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
27 hg convert --datesort $svnurl A-hg
0e91ef0b52e7 Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
28
0e91ef0b52e7 Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
29 cd A-hg
0e91ef0b52e7 Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
30 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
31 hg tags -q
0e91ef0b52e7 Add a test for svn tags conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
32 cd ..
6400
c237b27e1350 convert: allow tags detection to be disabled
Patrick Mezard <pmezard@gmail.com>
parents: 6399
diff changeset
33
c237b27e1350 convert: allow tags detection to be disabled
Patrick Mezard <pmezard@gmail.com>
parents: 6399
diff changeset
34 echo % convert without tags
c237b27e1350 convert: allow tags detection to be disabled
Patrick Mezard <pmezard@gmail.com>
parents: 6399
diff changeset
35 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
36 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
37