##// END OF EJS Templates
test-convert-mtn: test directory move
Patrick Mezard -
r6377:2cf67d00 default
parent child Browse files
Show More
@@ -1,75 +1,78 b''
1 1 #!/bin/sh
2 2
3 3 "$TESTDIR/hghave" mtn || exit 80
4 4
5 5 # Monotone directory is called .monotone on *nix and monotone
6 6 # on Windows. Having a variable here ease test patching.
7 7 mtndir=.monotone
8 8 echo "[extensions]" >> $HGRCPATH
9 9 echo "convert=" >> $HGRCPATH
10 10 echo 'hgext.graphlog =' >> $HGRCPATH
11 11
12 12 HOME=`pwd`/do_not_use_HOME_mtn; export HOME
13 13 # Windows version of monotone home
14 14 APPDATA=$HOME; export APPDATA
15 15
16 16 echo % tedious monotone keys configuration
17 17 # The /dev/null redirection is necessary under Windows, or
18 18 # it complains about home directory permissions
19 19 mtn --quiet genkey test@selenic.com 1>/dev/null 2>&1 <<EOF
20 20 passphrase
21 21 passphrase
22 22 EOF
23 23 cat >> $HOME/$mtndir/monotonerc <<EOF
24 24 function get_passphrase(keypair_id)
25 25 return "passphrase"
26 26 end
27 27 EOF
28 28
29 29 echo % create monotone repository
30 30 mtn db init --db=repo.mtn
31 31 mtn --db=repo.mtn --branch=com.selenic.test setup workingdir
32 32 cd workingdir
33 33 echo a > a
34 34 mkdir dir
35 35 echo b > dir/b
36 36 python -c 'file("bin", "wb").write("a\\x00b")'
37 37 echo c > c
38 38 mtn add a dir/b c bin
39 39 mtn ci -m initialize
40 40 echo % update monotone working directory
41 41 mtn mv a dir/a
42 42 echo a >> dir/a
43 43 echo b >> dir/b
44 44 mtn drop c
45 45 python -c 'file("bin", "wb").write("b\\x00c")'
46 46 mtn ci -m update1
47 47 cd ..
48 48
49 49 echo % convert once
50 50 hg convert -s mtn repo.mtn
51 51
52 52 cd workingdir
53 53 echo e > e
54 54 mtn add e
55 55 mtn drop dir/b
56 56 mtn mv bin bin2
57 57 mtn ci -m update2
58 # Test directory move
59 mtn mv dir dir2
60 mtn ci -m movedir
58 61 cd ..
59 62
60 63 echo % convert incrementally
61 64 hg convert -s mtn repo.mtn
62 65
63 66 glog()
64 67 {
65 68 hg glog --template '#rev# "#desc|firstline#" files: #files#\n' "$@"
66 69 }
67 70
68 71 cd repo.mtn-hg
69 72 hg up -C
70 73 glog
71 74 echo % manifest
72 75 hg manifest
73 76 echo % contents
74 cat dir/a
77 cat dir2/a
75 78
@@ -1,48 +1,54 b''
1 1 % tedious monotone keys configuration
2 2 % create monotone repository
3 3 mtn: adding a to workspace manifest
4 4 mtn: adding bin to workspace manifest
5 5 mtn: adding c to workspace manifest
6 6 mtn: adding dir to workspace manifest
7 7 mtn: adding dir/b to workspace manifest
8 8 mtn: beginning commit on branch 'com.selenic.test'
9 9 mtn: committed revision 803ef0bf815e35b951dbd4310acd1e45e675016e
10 10 % update monotone working directory
11 11 mtn: skipping dir, already accounted for in workspace
12 12 mtn: renaming a to dir/a in workspace manifest
13 13 mtn: dropping c from workspace manifest
14 14 mtn: beginning commit on branch 'com.selenic.test'
15 15 mtn: committed revision 4daf60753d6fe21a06ce5f716303fe55fd6d3a56
16 16 % convert once
17 17 assuming destination repo.mtn-hg
18 18 initializing destination repo.mtn-hg repository
19 19 scanning source...
20 20 sorting...
21 21 converting...
22 22 1 initialize
23 23 0 update1
24 24 mtn: adding e to workspace manifest
25 25 mtn: dropping dir/b from workspace manifest
26 26 mtn: renaming bin to bin2 in workspace manifest
27 27 mtn: beginning commit on branch 'com.selenic.test'
28 28 mtn: committed revision 6c6977a6ef609ec80e40779f89dbd2772c96de62
29 mtn: renaming dir to dir2 in workspace manifest
30 mtn: beginning commit on branch 'com.selenic.test'
31 mtn: committed revision 5de5abe7c15eae70cf3acdda23c9c319ea50c1af
29 32 % convert incrementally
30 33 assuming destination repo.mtn-hg
31 34 scanning source...
32 35 sorting...
33 36 converting...
34 0 update2
37 1 update2
38 0 movedir
35 39 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
36 @ 2 "update2" files: bin bin2 dir/b e
40 @ 3 "movedir" files: dir/a dir2/a
41 |
42 o 2 "update2" files: bin bin2 dir/b e
37 43 |
38 44 o 1 "update1" files: a bin c dir/a dir/b
39 45 |
40 46 o 0 "initialize" files: a bin c dir/b
41 47
42 48 % manifest
43 49 bin2
44 dir/a
50 dir2/a
45 51 e
46 52 % contents
47 53 a
48 54 a
General Comments 0
You need to be logged in to leave comments. Login now