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