author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
Mon, 27 Oct 2008 21:50:16 +0100 | |
changeset 7271 | 8046f0a070a6 |
parent 6851 | 6ec941b6003d |
child 7475 | 90d8dfb481e7 |
permissions | -rwxr-xr-x |
5955
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
1 |
#!/bin/sh |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
2 |
|
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
3 |
"$TESTDIR/hghave" svn svn-bindings || exit 80 |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
4 |
|
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
5 |
fix_path() |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
6 |
{ |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
7 |
tr '\\' / |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
8 |
} |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
9 |
|
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
10 |
echo "[extensions]" >> $HGRCPATH |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
11 |
echo "convert = " >> $HGRCPATH |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
12 |
echo "hgext.graphlog =" >> $HGRCPATH |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
13 |
|
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
14 |
svnadmin create svn-repo |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
15 |
|
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
16 |
svnpath=`pwd | fix_path` |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
17 |
# SVN wants all paths to start with a slash. Unfortunately, |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
18 |
# Windows ones don't. Handle that. |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
19 |
expr $svnpath : "\/" > /dev/null |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
20 |
if [ $? -ne 0 ]; then |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
21 |
svnpath='/'$svnpath |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
22 |
fi |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
23 |
|
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
24 |
echo % initial svn import |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
25 |
mkdir projA |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
26 |
cd projA |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
27 |
mkdir trunk |
5957
971a17af5982
convert: prevent svn branches to leave the root module tree
Patrick Mezard <pmezard@gmail.com>
parents:
5955
diff
changeset
|
28 |
echo a > trunk/a |
5955
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
29 |
mkdir trunk/d1 |
6543
a6e2e60b34d0
convert: handle past or foreign partial svn copies
Patrick Mezard <pmezard@gmail.com>
parents:
6439
diff
changeset
|
30 |
mkdir trunk/d2 |
5955
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
31 |
echo b > trunk/d1/b |
5957
971a17af5982
convert: prevent svn branches to leave the root module tree
Patrick Mezard <pmezard@gmail.com>
parents:
5955
diff
changeset
|
32 |
echo c > trunk/d1/c |
6543
a6e2e60b34d0
convert: handle past or foreign partial svn copies
Patrick Mezard <pmezard@gmail.com>
parents:
6439
diff
changeset
|
33 |
echo d > trunk/d2/d |
5955
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
34 |
cd .. |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
35 |
|
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
36 |
svnurl=file://$svnpath/svn-repo/projA |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
37 |
svn import -m "init projA" projA $svnurl | fix_path |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
38 |
|
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
39 |
# Build a module renaming chain which used to confuse the converter. |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
40 |
echo % update svn repository |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
41 |
svn co $svnurl A | fix_path |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
42 |
cd A |
6439
c1b47c0fd2b6
convert: fix test-convert-svn-* problems with mtime not changing
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
5957
diff
changeset
|
43 |
"$TESTDIR/svn-safe-append.py" a trunk/a |
c1b47c0fd2b6
convert: fix test-convert-svn-* problems with mtime not changing
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
5957
diff
changeset
|
44 |
"$TESTDIR/svn-safe-append.py" c trunk/d1/c |
5957
971a17af5982
convert: prevent svn branches to leave the root module tree
Patrick Mezard <pmezard@gmail.com>
parents:
5955
diff
changeset
|
45 |
svn ci -m commitbeforemove |
5955
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
46 |
svn mv $svnurl/trunk $svnurl/subproject -m movedtrunk |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
47 |
svn up |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
48 |
mkdir subproject/trunk |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
49 |
svn add subproject/trunk |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
50 |
svn ci -m createtrunk |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
51 |
mkdir subproject/branches |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
52 |
svn add subproject/branches |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
53 |
svn ci -m createbranches |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
54 |
svn mv $svnurl/subproject/d1 $svnurl/subproject/trunk/d1 -m moved1 |
6543
a6e2e60b34d0
convert: handle past or foreign partial svn copies
Patrick Mezard <pmezard@gmail.com>
parents:
6439
diff
changeset
|
55 |
svn mv $svnurl/subproject/d2 $svnurl/subproject/trunk/d2 -m moved2 |
5955
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
56 |
svn up |
6439
c1b47c0fd2b6
convert: fix test-convert-svn-* problems with mtime not changing
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
5957
diff
changeset
|
57 |
"$TESTDIR/svn-safe-append.py" b subproject/trunk/d1/b |
6543
a6e2e60b34d0
convert: handle past or foreign partial svn copies
Patrick Mezard <pmezard@gmail.com>
parents:
6439
diff
changeset
|
58 |
svn rm subproject/trunk/d2 |
a6e2e60b34d0
convert: handle past or foreign partial svn copies
Patrick Mezard <pmezard@gmail.com>
parents:
6439
diff
changeset
|
59 |
svn ci -m "changeb and rm d2" |
5955
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
60 |
svn mv $svnurl/subproject/trunk/d1 $svnurl/subproject/branches/d1 -m moved1again |
6851
6ec941b6003d
Fix subversion tests with svn 1.5
Patrick Mezard <pmezard@gmail.com>
parents:
6546
diff
changeset
|
61 |
|
6ec941b6003d
Fix subversion tests with svn 1.5
Patrick Mezard <pmezard@gmail.com>
parents:
6546
diff
changeset
|
62 |
if svn help copy | grep 'SRC\[@REV\]' > /dev/null 2>&1; then |
6ec941b6003d
Fix subversion tests with svn 1.5
Patrick Mezard <pmezard@gmail.com>
parents:
6546
diff
changeset
|
63 |
# SVN >= 1.5 replaced the -r REV syntax with @REV |
6ec941b6003d
Fix subversion tests with svn 1.5
Patrick Mezard <pmezard@gmail.com>
parents:
6546
diff
changeset
|
64 |
echo % copy a file from a past revision |
6ec941b6003d
Fix subversion tests with svn 1.5
Patrick Mezard <pmezard@gmail.com>
parents:
6546
diff
changeset
|
65 |
svn copy $svnurl/subproject/trunk/d2/d@7 $svnurl/subproject/trunk -m copyfilefrompast |
6ec941b6003d
Fix subversion tests with svn 1.5
Patrick Mezard <pmezard@gmail.com>
parents:
6546
diff
changeset
|
66 |
echo % copy a directory from a past revision |
6ec941b6003d
Fix subversion tests with svn 1.5
Patrick Mezard <pmezard@gmail.com>
parents:
6546
diff
changeset
|
67 |
svn copy $svnurl/subproject/trunk/d2@7 $svnurl/subproject/trunk -m copydirfrompast |
6ec941b6003d
Fix subversion tests with svn 1.5
Patrick Mezard <pmezard@gmail.com>
parents:
6546
diff
changeset
|
68 |
else |
6ec941b6003d
Fix subversion tests with svn 1.5
Patrick Mezard <pmezard@gmail.com>
parents:
6546
diff
changeset
|
69 |
echo % copy a file from a past revision |
6ec941b6003d
Fix subversion tests with svn 1.5
Patrick Mezard <pmezard@gmail.com>
parents:
6546
diff
changeset
|
70 |
svn copy -r 7 $svnurl/subproject/trunk/d2/d $svnurl/subproject/trunk -m copyfilefrompast |
6ec941b6003d
Fix subversion tests with svn 1.5
Patrick Mezard <pmezard@gmail.com>
parents:
6546
diff
changeset
|
71 |
echo % copy a directory from a past revision |
6ec941b6003d
Fix subversion tests with svn 1.5
Patrick Mezard <pmezard@gmail.com>
parents:
6546
diff
changeset
|
72 |
svn copy -r 7 $svnurl/subproject/trunk/d2 $svnurl/subproject/trunk -m copydirfrompast |
6ec941b6003d
Fix subversion tests with svn 1.5
Patrick Mezard <pmezard@gmail.com>
parents:
6546
diff
changeset
|
73 |
fi |
5955
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
74 |
cd .. |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
75 |
|
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
76 |
echo % convert trunk and branches |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
77 |
hg convert --datesort $svnurl/subproject A-hg |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
78 |
|
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
79 |
cd A-hg |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
80 |
hg glog --template '#rev# #desc|firstline# files: #files#\n' |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
81 |
hg branches | sed 's/:.*/:/' |
c4496b7c10ce
convert: fix svn_source.latest()
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
82 |
cd .. |