author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
Sat, 29 Mar 2008 21:15:34 +0100 | |
changeset 6403 | f615ece5fec3 |
parent 6377 | 2cf67d007f41 |
child 6396 | 18eeabae6148 |
permissions | -rwxr-xr-x |
6372
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
1 |
#!/bin/sh |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
2 |
|
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
3 |
"$TESTDIR/hghave" mtn || exit 80 |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
4 |
|
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
5 |
# Monotone directory is called .monotone on *nix and monotone |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
6 |
# on Windows. Having a variable here ease test patching. |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
7 |
mtndir=.monotone |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
8 |
echo "[extensions]" >> $HGRCPATH |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
9 |
echo "convert=" >> $HGRCPATH |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
10 |
echo 'hgext.graphlog =' >> $HGRCPATH |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
11 |
|
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
12 |
HOME=`pwd`/do_not_use_HOME_mtn; export HOME |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
13 |
# Windows version of monotone home |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
14 |
APPDATA=$HOME; export APPDATA |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
15 |
|
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
16 |
echo % tedious monotone keys configuration |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
17 |
# The /dev/null redirection is necessary under Windows, or |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
18 |
# it complains about home directory permissions |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
19 |
mtn --quiet genkey test@selenic.com 1>/dev/null 2>&1 <<EOF |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
20 |
passphrase |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
21 |
passphrase |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
22 |
EOF |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
23 |
cat >> $HOME/$mtndir/monotonerc <<EOF |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
24 |
function get_passphrase(keypair_id) |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
25 |
return "passphrase" |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
26 |
end |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
27 |
EOF |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
28 |
|
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
29 |
echo % create monotone repository |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
30 |
mtn db init --db=repo.mtn |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
31 |
mtn --db=repo.mtn --branch=com.selenic.test setup workingdir |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
32 |
cd workingdir |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
33 |
echo a > a |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
34 |
mkdir dir |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
35 |
echo b > dir/b |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
36 |
python -c 'file("bin", "wb").write("a\\x00b")' |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
37 |
echo c > c |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
38 |
mtn add a dir/b c bin |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
39 |
mtn ci -m initialize |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
40 |
echo % update monotone working directory |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
41 |
mtn mv a dir/a |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
42 |
echo a >> dir/a |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
43 |
echo b >> dir/b |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
44 |
mtn drop c |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
45 |
python -c 'file("bin", "wb").write("b\\x00c")' |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
46 |
mtn ci -m update1 |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
47 |
cd .. |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
48 |
|
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
49 |
echo % convert once |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
50 |
hg convert -s mtn repo.mtn |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
51 |
|
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
52 |
cd workingdir |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
53 |
echo e > e |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
54 |
mtn add e |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
55 |
mtn drop dir/b |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
56 |
mtn mv bin bin2 |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
57 |
mtn ci -m update2 |
6377
2cf67d007f41
test-convert-mtn: test directory move
Patrick Mezard <pmezard@gmail.com>
parents:
6376
diff
changeset
|
58 |
# Test directory move |
2cf67d007f41
test-convert-mtn: test directory move
Patrick Mezard <pmezard@gmail.com>
parents:
6376
diff
changeset
|
59 |
mtn mv dir dir2 |
2cf67d007f41
test-convert-mtn: test directory move
Patrick Mezard <pmezard@gmail.com>
parents:
6376
diff
changeset
|
60 |
mtn ci -m movedir |
6372
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
61 |
cd .. |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
62 |
|
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
63 |
echo % convert incrementally |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
64 |
hg convert -s mtn repo.mtn |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
65 |
|
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
66 |
glog() |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
67 |
{ |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
68 |
hg glog --template '#rev# "#desc|firstline#" files: #files#\n' "$@" |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
69 |
} |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
70 |
|
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
71 |
cd repo.mtn-hg |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
72 |
hg up -C |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
73 |
glog |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
74 |
echo % manifest |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
75 |
hg manifest |
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
76 |
echo % contents |
6377
2cf67d007f41
test-convert-mtn: test directory move
Patrick Mezard <pmezard@gmail.com>
parents:
6376
diff
changeset
|
77 |
cat dir2/a |
6372
8f79820443a4
Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
78 |