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