##// END OF EJS Templates
tests: no need to explicitly export HOME in test files...
Idan Kamara -
r13765:7fc79055 default
parent child Browse files
Show More
@@ -1,83 +1,79
1 1 #!/bin/sh
2 2
3 3 "$TESTDIR/hghave" baz || exit 80
4 4
5 mkdir do_not_use_HOME_baz
6 cd do_not_use_HOME_baz
7 HOME=`pwd`; export HOME
8 cd ..
9 5 baz my-id "mercurial <mercurial@selenic.com>"
10 6
11 7 echo "[extensions]" >> $HGRCPATH
12 8 echo "convert=" >> $HGRCPATH
13 9 echo 'graphlog =' >> $HGRCPATH
14 10
15 11 echo % create baz archive
16 12 baz make-archive baz@mercurial--convert hg-test-convert-baz
17 13
18 14 echo % initialize baz repo
19 15 mkdir baz-repo
20 16 cd baz-repo/
21 17 baz init-tree baz@mercurial--convert/baz--test--0
22 18 baz import
23 19
24 20 echo % create initial files
25 21 echo 'this is a file' > a
26 22 baz add a
27 23 mkdir src
28 24 baz add src
29 25 cd src
30 26 dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null
31 27 baz add b
32 28 # HACK: hide GNU tar-1.22 "tar: The --preserve option is deprecated, use --preserve-permissions --preserve-order instead"
33 29 baz commit -s "added a file, src and src/b (binary)" 2>&1 | grep -v '^tar'
34 30
35 31 echo % create link file and modify a
36 32 ln -s ../a a-link
37 33 baz add a-link
38 34 echo 'this a modification to a' >> ../a
39 35 baz commit -s "added link to a and modify a"
40 36
41 37 echo % create second link and modify b
42 38 ln -s ../a a-link-2
43 39 baz add a-link-2
44 40 dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null
45 41 baz commit -s "added second link and modify b"
46 42
47 43 echo % b file to link and a-link-2 to regular file
48 44 rm -f a-link-2
49 45 echo 'this is now a regular file' > a-link-2
50 46 ln -sf ../a b
51 47 baz commit -s "file to link and link to file test"
52 48
53 49 echo % move a-link-2 file and src directory
54 50 cd ..
55 51 baz mv src/a-link-2 c
56 52 baz mv src test
57 53 baz commit -s "move and rename a-link-2 file and src directory"
58 54
59 55 echo % move and add the moved file again
60 56 echo e > e
61 57 baz add e
62 58 baz commit -s "add e"
63 59 baz mv e f
64 60 echo ee > e
65 61 baz add e
66 62 baz commit -s "move e and recreate it again"
67 63 cd ..
68 64
69 65 echo % converting baz repo to Mercurial
70 66 hg convert baz-repo baz-repo-hg
71 67
72 68 baz register-archive -d baz@mercurial--convert
73 69
74 70 glog()
75 71 {
76 72 hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
77 73 }
78 74
79 75 echo % show graph log
80 76 glog -R baz-repo-hg
81 77 hg up -q -R baz-repo-hg
82 78 hg -R baz-repo-hg manifest --debug
83 79 hg -R baz-repo-hg log -r 5 -r 7 -C --debug | grep copies
@@ -1,144 +1,143
1 1
2 2 $ "$TESTDIR/hghave" darcs || exit 80
3 3 $ echo "[extensions]" >> $HGRCPATH
4 4 $ echo "convert=" >> $HGRCPATH
5 5 $ echo 'graphlog =' >> $HGRCPATH
6 6 $ DARCS_EMAIL='test@example.org'; export DARCS_EMAIL
7 $ HOME=`pwd`/do_not_use_HOME_darcs; export HOME
8 7
9 8 skip if we can't import elementtree
10 9
11 10 $ mkdir dummy
12 11 $ mkdir dummy/_darcs
13 12 $ if hg convert dummy 2>&1 | grep ElementTree > /dev/null; then
14 13 > echo 'skipped: missing feature: elementtree module'
15 14 > exit 80
16 15 > fi
17 16
18 17 try converting darcs1 repository
19 18
20 19 $ hg clone -q "$TESTDIR/darcs1.hg" darcs
21 20 $ hg convert -s darcs darcs/darcs1 2>&1 | grep darcs-1.0
22 21 darcs-1.0 repository format is unsupported, please upgrade
23 22
24 23 initialize darcs repo
25 24
26 25 $ mkdir darcs-repo
27 26 $ cd darcs-repo
28 27 $ darcs init
29 28 $ echo a > a
30 29 $ darcs record -a -l -m p0
31 30 Finished recording patch 'p0'
32 31 $ cd ..
33 32
34 33 branch and update
35 34
36 35 $ darcs get darcs-repo darcs-clone >/dev/null
37 36 $ cd darcs-clone
38 37 $ echo c >> a
39 38 $ echo c > c
40 39 $ darcs record -a -l -m p1.1
41 40 Finished recording patch 'p1.1'
42 41 $ cd ..
43 42
44 43 update source
45 44
46 45 $ cd darcs-repo
47 46 $ echo b >> a
48 47 $ echo b > b
49 48 $ darcs record -a -l -m p1.2
50 49 Finished recording patch 'p1.2'
51 50
52 51 $ darcs pull -a ../darcs-clone
53 52 Backing up ./a(-darcs-backup0)
54 53 We have conflicts in the following files:
55 54 ./a
56 55 Finished pulling and applying.
57 56 $ sleep 1
58 57 $ echo e > a
59 58 $ echo f > f
60 59 $ mkdir dir
61 60 $ echo d > dir/d
62 61 $ echo d > dir/d2
63 62 $ darcs record -a -l -m p2
64 63 Finished recording patch 'p2'
65 64
66 65 test file and directory move
67 66
68 67 $ darcs mv f ff
69 68
70 69 Test remove + move
71 70
72 71 $ darcs remove dir/d2
73 72 $ rm dir/d2
74 73 $ darcs mv dir dir2
75 74 $ darcs record -a -l -m p3
76 75 Finished recording patch 'p3'
77 76
78 77 test utf-8 commit message and author
79 78
80 79 $ echo g > g
81 80
82 81 darcs is encoding agnostic, so it takes whatever bytes it's given
83 82
84 83 $ darcs record -a -l -m 'p4: desc Γ±' -A 'author Γ±'
85 84 Finished recording patch 'p4: desc \xc3\xb1' (esc)
86 85
87 86 Test latin-1 commit message
88 87
89 88 $ echo h > h
90 89 $ printf "p5: desc " > ../p5
91 90 $ python -c 'print "".join([chr(i) for i in range(128, 256)])' >> ../p5
92 91 $ darcs record -a -l --logfile ../p5
93 92 Finished recording patch 'p5: desc \x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff' (esc)
94 93
95 94 $ glog()
96 95 > {
97 96 > HGENCODING=utf-8 hg glog --template '{rev} "{desc|firstline}" ({author}) files: {files}\n' "$@"
98 97 > }
99 98 $ cd ..
100 99 $ hg convert darcs-repo darcs-repo-hg
101 100 initializing destination darcs-repo-hg repository
102 101 scanning source...
103 102 sorting...
104 103 converting...
105 104 6 p0
106 105 5 p1.2
107 106 4 p1.1
108 107 3 p2
109 108 2 p3
110 109 1 p4: desc ?
111 110 0 p5: desc ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
112 111
113 112 The converter does not currently handle patch conflicts very well.
114 113 When they occur, it reverts *all* changes and moves forward,
115 114 letting the conflict resolving patch fix collisions.
116 115 Unfortunately, non-conflicting changes, like the addition of the
117 116 "c" file in p1.1 patch are reverted too.
118 117 Just to say that manifest not listing "c" here is a bug.
119 118
120 119 $ HGENCODING=latin-1 glog -R darcs-repo-hg -r 6
121 120 o 6 "p5: desc \xc2\x80\xc2\x81\xc2\x82\xc2\x83\xc2\x84\xc2\x85\xc2\x86\xc2\x87\xc2\x88\xc2\x89\xc2\x8a\xc2\x8b\xc2\x8c\xc2\x8d\xc2\x8e\xc2\x8f\xc2\x90\xc2\x91\xc2\x92\xc2\x93\xc2\x94\xc2\x95\xc2\x96\xc2\x97\xc2\x98\xc2\x99\xc2\x9a\xc2\x9b\xc2\x9c\xc2\x9d\xc2\x9e\xc2\x9f\xc2\xa0\xc2\xa1\xc2\xa2\xc2\xa3\xc2\xa4\xc2\xa5\xc2\xa6\xc2\xa7\xc2\xa8\xc2\xa9\xc2\xaa\xc2\xab\xc2\xac\xc2\xad\xc2\xae\xc2\xaf\xc2\xb0\xc2\xb1\xc2\xb2\xc2\xb3\xc2\xb4\xc2\xb5\xc2\xb6\xc2\xb7\xc2\xb8\xc2\xb9\xc2\xba\xc2\xbb\xc2\xbc\xc2\xbd\xc2\xbe\xc2\xbf\xc3\x80\xc3\x81\xc3\x82\xc3\x83\xc3\x84\xc3\x85\xc3\x86\xc3\x87\xc3\x88\xc3\x89\xc3\x8a\xc3\x8b\xc3\x8c\xc3\x8d\xc3\x8e\xc3\x8f\xc3\x90\xc3\x91\xc3\x92\xc3\x93\xc3\x94\xc3\x95\xc3\x96\xc3\x97\xc3\x98\xc3\x99\xc3\x9a\xc3\x9b\xc3\x9c\xc3\x9d\xc3\x9e\xc3\x9f\xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4\xc3\xa5\xc3\xa6\xc3\xa7\xc3\xa8\xc3\xa9\xc3\xaa\xc3\xab\xc3\xac\xc3\xad\xc3\xae\xc3\xaf\xc3\xb0\xc3\xb1\xc3\xb2\xc3\xb3\xc3\xb4\xc3\xb5\xc3\xb6\xc3\xb7\xc3\xb8\xc3\xb9\xc3\xba\xc3\xbb\xc3\xbc\xc3\xbd\xc3\xbe\xc3\xbf" (test@example.org) files: h (esc)
122 121 |
123 122 $ HGENCODING=utf-8 glog -R darcs-repo-hg -r 0:5
124 123 o 5 "p4: desc \xc3\xb1" (author \xc3\xb1) files: g (esc)
125 124 |
126 125 o 4 "p3" (test@example.org) files: dir/d dir/d2 dir2/d f ff
127 126 |
128 127 o 3 "p2" (test@example.org) files: a dir/d dir/d2 f
129 128 |
130 129 o 2 "p1.1" (test@example.org) files:
131 130 |
132 131 o 1 "p1.2" (test@example.org) files: a b
133 132 |
134 133 o 0 "p0" (test@example.org) files: a
135 134
136 135
137 136 $ hg up -q -R darcs-repo-hg
138 137 $ hg -R darcs-repo-hg manifest --debug
139 138 7225b30cdf38257d5cc7780772c051b6f33e6d6b 644 a
140 139 1e88685f5ddec574a34c70af492f95b6debc8741 644 b
141 140 37406831adc447ec2385014019599dfec953c806 644 dir2/d
142 141 b783a337463792a5c7d548ad85a7d3253c16ba8c 644 ff
143 142 0973eb1b2ecc4de7fafe7447ce1b7462108b4848 644 g
144 143 fe6f8b4f507fe3eb524c527192a84920a4288dac 644 h
@@ -1,358 +1,357
1 1
2 2 $ "$TESTDIR/hghave" mtn || exit 80
3 3
4 4 Monotone directory is called .monotone on *nix and monotone
5 5 on Windows. Having a variable here ease test patching.
6 6
7 7 $ mtndir=.monotone
8 8 $ echo "[extensions]" >> $HGRCPATH
9 9 $ echo "convert=" >> $HGRCPATH
10 10 $ echo 'graphlog =' >> $HGRCPATH
11 $ HOME=`pwd`/do_not_use_HOME_mtn; export HOME
12 11
13 12 Windows version of monotone home
14 13
15 14 $ APPDATA=$HOME; export APPDATA
16 15
17 16 tedious monotone keys configuration
18 17 The /dev/null redirection is necessary under Windows, or
19 18 it complains about home directory permissions
20 19
21 20 $ mtn --quiet genkey test@selenic.com 1>/dev/null 2>&1 <<EOF
22 21 > passphrase
23 22 > passphrase
24 23 > EOF
25 24 $ cat >> $HOME/$mtndir/monotonerc <<EOF
26 25 > function get_passphrase(keypair_id)
27 26 > return "passphrase"
28 27 > end
29 28 > EOF
30 29
31 30 create monotone repository
32 31
33 32 $ mtn db init --db=repo.mtn
34 33 $ mtn --db=repo.mtn --branch=com.selenic.test setup workingdir
35 34 $ cd workingdir
36 35 $ echo a > a
37 36 $ mkdir dir
38 37 $ echo b > dir/b
39 38 $ echo d > dir/d
40 39 $ python -c 'file("bin", "wb").write("a\\x00b")'
41 40 $ echo c > c
42 41 $ mtn add a dir/b dir/d c bin
43 42 mtn: adding a to workspace manifest
44 43 mtn: adding bin to workspace manifest
45 44 mtn: adding c to workspace manifest
46 45 mtn: adding dir to workspace manifest
47 46 mtn: adding dir/b to workspace manifest
48 47 mtn: adding dir/d to workspace manifest
49 48 $ mtn ci -m initialize
50 49 mtn: beginning commit on branch 'com.selenic.test'
51 50 mtn: committed revision 0f6e5e4f2e7d2a8ef312408f57618abf026afd90
52 51
53 52 update monotone working directory
54 53
55 54 $ mtn mv a dir/a
56 55 mtn: skipping dir, already accounted for in workspace
57 56 mtn: renaming a to dir/a in workspace manifest
58 57 $ echo a >> dir/a
59 58 $ echo b >> dir/b
60 59 $ mtn drop c
61 60 mtn: dropping c from workspace manifest
62 61 $ python -c 'file("bin", "wb").write("b\\x00c")'
63 62 $ mtn ci -m update1
64 63 mtn: beginning commit on branch 'com.selenic.test'
65 64 mtn: committed revision 51d0a982464573a2a2cf5ee2c9219c652aaebeff
66 65 $ cd ..
67 66
68 67 convert once
69 68
70 69 $ hg convert -s mtn repo.mtn
71 70 assuming destination repo.mtn-hg
72 71 initializing destination repo.mtn-hg repository
73 72 scanning source...
74 73 sorting...
75 74 converting...
76 75 1 initialize
77 76 0 update1
78 77 $ cd workingdir
79 78 $ echo e > e
80 79 $ mtn add e
81 80 mtn: adding e to workspace manifest
82 81 $ mtn drop dir/b
83 82 mtn: dropping dir/b from workspace manifest
84 83 $ mtn mv bin bin2
85 84 mtn: renaming bin to bin2 in workspace manifest
86 85 $ mtn ci -m 'update2 "with" quotes'
87 86 mtn: beginning commit on branch 'com.selenic.test'
88 87 mtn: committed revision ebe58335d85d8cb176b6d0a12be04f5314b998da
89 88
90 89 test directory move
91 90
92 91 $ mkdir -p dir1/subdir1
93 92 $ mkdir -p dir1/subdir2_other
94 93 $ echo file1 > dir1/subdir1/file1
95 94 $ echo file2 > dir1/subdir2_other/file1
96 95 $ mtn add dir1/subdir1/file1 dir1/subdir2_other/file1
97 96 mtn: adding dir1 to workspace manifest
98 97 mtn: adding dir1/subdir1 to workspace manifest
99 98 mtn: adding dir1/subdir1/file1 to workspace manifest
100 99 mtn: adding dir1/subdir2_other to workspace manifest
101 100 mtn: adding dir1/subdir2_other/file1 to workspace manifest
102 101 $ mtn ci -m createdir1
103 102 mtn: beginning commit on branch 'com.selenic.test'
104 103 mtn: committed revision a8d62bc04fee4d2936d28e98bbcc81686dd74306
105 104 $ mtn rename dir1/subdir1 dir1/subdir2
106 105 mtn: skipping dir1, already accounted for in workspace
107 106 mtn: renaming dir1/subdir1 to dir1/subdir2 in workspace manifest
108 107 $ mtn ci -m movedir1
109 108 mtn: beginning commit on branch 'com.selenic.test'
110 109 mtn: committed revision 2c3d241bbbfe538b1b51d910f5676407e3f4d3a6
111 110
112 111 test subdirectory move
113 112
114 113 $ mtn mv dir dir2
115 114 mtn: renaming dir to dir2 in workspace manifest
116 115 $ echo newfile > dir2/newfile
117 116 $ mtn drop dir2/d
118 117 mtn: dropping dir2/d from workspace manifest
119 118 $ mtn add dir2/newfile
120 119 mtn: adding dir2/newfile to workspace manifest
121 120 $ mtn ci -m movedir
122 121 mtn: beginning commit on branch 'com.selenic.test'
123 122 mtn: committed revision fdb5a02dae8bfce3a79b3393680af471016e1b4c
124 123
125 124 Test directory removal with empty directory
126 125
127 126 $ mkdir dir2/dir
128 127 $ mkdir dir2/dir/subdir
129 128 $ echo f > dir2/dir/subdir/f
130 129 $ mkdir dir2/dir/emptydir
131 130 $ mtn add --quiet -R dir2/dir
132 131 $ mtn ci -m emptydir
133 132 mtn: beginning commit on branch 'com.selenic.test'
134 133 mtn: committed revision 8bbf76d717001d24964e4604739fdcd0f539fc88
135 134 $ mtn drop -R dir2/dir
136 135 mtn: dropping dir2/dir/subdir/f from workspace manifest
137 136 mtn: dropping dir2/dir/subdir from workspace manifest
138 137 mtn: dropping dir2/dir/emptydir from workspace manifest
139 138 mtn: dropping dir2/dir from workspace manifest
140 139 $ mtn ci -m dropdirectory
141 140 mtn: beginning commit on branch 'com.selenic.test'
142 141 mtn: committed revision 2323d4bc324e6c82628dc04d47a9fd32ad24e322
143 142
144 143 test directory and file move
145 144
146 145 $ mkdir -p dir3/d1
147 146 $ echo a > dir3/a
148 147 $ mtn add dir3/a dir3/d1
149 148 mtn: adding dir3 to workspace manifest
150 149 mtn: adding dir3/a to workspace manifest
151 150 mtn: adding dir3/d1 to workspace manifest
152 151 $ mtn ci -m dirfilemove
153 152 mtn: beginning commit on branch 'com.selenic.test'
154 153 mtn: committed revision 47b192f720faa622f48c68d1eb075b26d405aa8b
155 154 $ mtn mv dir3/a dir3/d1/a
156 155 mtn: skipping dir3/d1, already accounted for in workspace
157 156 mtn: renaming dir3/a to dir3/d1/a in workspace manifest
158 157 $ mtn mv dir3/d1 dir3/d2
159 158 mtn: skipping dir3, already accounted for in workspace
160 159 mtn: renaming dir3/d1 to dir3/d2 in workspace manifest
161 160 $ mtn ci -m dirfilemove2
162 161 mtn: beginning commit on branch 'com.selenic.test'
163 162 mtn: committed revision 8b543a400d3ee7f6d4bb1835b9b9e3747c8cb632
164 163
165 164 test directory move into another directory move
166 165
167 166 $ mkdir dir4
168 167 $ mkdir dir5
169 168 $ echo a > dir4/a
170 169 $ mtn add dir4/a dir5
171 170 mtn: adding dir4 to workspace manifest
172 171 mtn: adding dir4/a to workspace manifest
173 172 mtn: adding dir5 to workspace manifest
174 173 $ mtn ci -m dirdirmove
175 174 mtn: beginning commit on branch 'com.selenic.test'
176 175 mtn: committed revision 466e0b2afc7a55aa2b4ab2f57cb240bb6cd66fc7
177 176 $ mtn mv dir5 dir6
178 177 mtn: renaming dir5 to dir6 in workspace manifest
179 178 $ mtn mv dir4 dir6/dir4
180 179 mtn: skipping dir6, already accounted for in workspace
181 180 mtn: renaming dir4 to dir6/dir4 in workspace manifest
182 181 $ mtn ci -m dirdirmove2
183 182 mtn: beginning commit on branch 'com.selenic.test'
184 183 mtn: committed revision 3d1f77ebad0c23a5d14911be3b670f990991b749
185 184
186 185 test diverging directory moves
187 186
188 187 $ mkdir -p dir7/dir9/dir8
189 188 $ echo a > dir7/dir9/dir8/a
190 189 $ echo b > dir7/dir9/b
191 190 $ echo c > dir7/c
192 191 $ mtn add -R dir7
193 192 mtn: adding dir7 to workspace manifest
194 193 mtn: adding dir7/c to workspace manifest
195 194 mtn: adding dir7/dir9 to workspace manifest
196 195 mtn: adding dir7/dir9/b to workspace manifest
197 196 mtn: adding dir7/dir9/dir8 to workspace manifest
198 197 mtn: adding dir7/dir9/dir8/a to workspace manifest
199 198 $ mtn ci -m divergentdirmove
200 199 mtn: beginning commit on branch 'com.selenic.test'
201 200 mtn: committed revision 08a08511f18b428d840199b062de90d0396bc2ed
202 201 $ mtn mv dir7 dir7-2
203 202 mtn: renaming dir7 to dir7-2 in workspace manifest
204 203 $ mtn mv dir7-2/dir9 dir9-2
205 204 mtn: renaming dir7-2/dir9 to dir9-2 in workspace manifest
206 205 $ mtn mv dir9-2/dir8 dir8-2
207 206 mtn: renaming dir9-2/dir8 to dir8-2 in workspace manifest
208 207 $ mtn ci -m divergentdirmove2
209 208 mtn: beginning commit on branch 'com.selenic.test'
210 209 mtn: committed revision 4a736634505795f17786fffdf2c9cbf5b11df6f6
211 210 $ cd ..
212 211
213 212 convert incrementally
214 213
215 214 $ hg convert -s mtn repo.mtn
216 215 assuming destination repo.mtn-hg
217 216 scanning source...
218 217 sorting...
219 218 converting...
220 219 11 update2 "with" quotes
221 220 10 createdir1
222 221 9 movedir1
223 222 8 movedir
224 223 7 emptydir
225 224 6 dropdirectory
226 225 5 dirfilemove
227 226 4 dirfilemove2
228 227 3 dirdirmove
229 228 2 dirdirmove2
230 229 1 divergentdirmove
231 230 0 divergentdirmove2
232 231 $ glog()
233 232 > {
234 233 > hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
235 234 > }
236 235 $ cd repo.mtn-hg
237 236 $ hg up -C
238 237 11 files updated, 0 files merged, 0 files removed, 0 files unresolved
239 238 $ glog
240 239 @ 13 "divergentdirmove2" files: dir7-2/c dir7/c dir7/dir9/b dir7/dir9/dir8/a dir8-2/a dir9-2/b
241 240 |
242 241 o 12 "divergentdirmove" files: dir7/c dir7/dir9/b dir7/dir9/dir8/a
243 242 |
244 243 o 11 "dirdirmove2" files: dir4/a dir6/dir4/a
245 244 |
246 245 o 10 "dirdirmove" files: dir4/a
247 246 |
248 247 o 9 "dirfilemove2" files: dir3/a dir3/d2/a
249 248 |
250 249 o 8 "dirfilemove" files: dir3/a
251 250 |
252 251 o 7 "dropdirectory" files: dir2/dir/subdir/f
253 252 |
254 253 o 6 "emptydir" files: dir2/dir/subdir/f
255 254 |
256 255 o 5 "movedir" files: dir/a dir/d dir2/a dir2/newfile
257 256 |
258 257 o 4 "movedir1" files: dir1/subdir1/file1 dir1/subdir2/file1
259 258 |
260 259 o 3 "createdir1" files: dir1/subdir1/file1 dir1/subdir2_other/file1
261 260 |
262 261 o 2 "update2 "with" quotes" files: bin bin2 dir/b e
263 262 |
264 263 o 1 "update1" files: a bin c dir/a dir/b
265 264 |
266 265 o 0 "initialize" files: a bin c dir/b dir/d
267 266
268 267
269 268 manifest
270 269
271 270 $ hg manifest
272 271 bin2
273 272 dir1/subdir2/file1
274 273 dir1/subdir2_other/file1
275 274 dir2/a
276 275 dir2/newfile
277 276 dir3/d2/a
278 277 dir6/dir4/a
279 278 dir7-2/c
280 279 dir8-2/a
281 280 dir9-2/b
282 281 e
283 282
284 283 contents
285 284
286 285 $ cat dir2/a
287 286 a
288 287 a
289 288 $ test -d dir2/dir && echo 'removed dir2/dir is still there!'
290 289 [1]
291 290
292 291 file move
293 292
294 293 $ hg log -v -C -r 1 | grep copies
295 294 copies: dir/a (a)
296 295
297 296 check directory move
298 297
299 298 $ hg manifest -r 4
300 299 bin2
301 300 dir/a
302 301 dir/d
303 302 dir1/subdir2/file1
304 303 dir1/subdir2_other/file1
305 304 e
306 305 $ test -d dir1/subdir2 || echo 'new dir1/subdir2 does not exist!'
307 306 $ test -d dir1/subdir1 && echo 'renamed dir1/subdir1 is still there!'
308 307 [1]
309 308 $ hg log -v -C -r 4 | grep copies
310 309 copies: dir1/subdir2/file1 (dir1/subdir1/file1)
311 310
312 311 check file remove with directory move
313 312
314 313 $ hg manifest -r 5
315 314 bin2
316 315 dir1/subdir2/file1
317 316 dir1/subdir2_other/file1
318 317 dir2/a
319 318 dir2/newfile
320 319 e
321 320
322 321 check file move with directory move
323 322
324 323 $ hg manifest -r 9
325 324 bin2
326 325 dir1/subdir2/file1
327 326 dir1/subdir2_other/file1
328 327 dir2/a
329 328 dir2/newfile
330 329 dir3/d2/a
331 330 e
332 331
333 332 check file directory directory move
334 333
335 334 $ hg manifest -r 11
336 335 bin2
337 336 dir1/subdir2/file1
338 337 dir1/subdir2_other/file1
339 338 dir2/a
340 339 dir2/newfile
341 340 dir3/d2/a
342 341 dir6/dir4/a
343 342 e
344 343
345 344 check divergent directory moves
346 345
347 346 $ hg manifest -r 13
348 347 bin2
349 348 dir1/subdir2/file1
350 349 dir1/subdir2_other/file1
351 350 dir2/a
352 351 dir2/newfile
353 352 dir3/d2/a
354 353 dir6/dir4/a
355 354 dir7-2/c
356 355 dir8-2/a
357 356 dir9-2/b
358 357 e
@@ -1,139 +1,135
1 1
2 2 $ "$TESTDIR/hghave" tla || exit 80
3 $ mkdir do_not_use_HOME_tla
4 $ cd do_not_use_HOME_tla
5 $ HOME=`pwd`; export HOME
6 $ cd ..
7 3 $ tla my-id "mercurial <mercurial@selenic.com>"
8 4 $ echo "[extensions]" >> $HGRCPATH
9 5 $ echo "convert=" >> $HGRCPATH
10 6 $ echo 'graphlog =' >> $HGRCPATH
11 7
12 8 create tla archive
13 9
14 10 $ tla make-archive tla@mercurial--convert `pwd`/hg-test-convert-tla
15 11
16 12 initialize tla repo
17 13
18 14 $ mkdir tla-repo
19 15 $ cd tla-repo/
20 16 $ tla init-tree tla@mercurial--convert/tla--test--0
21 17 $ tla import
22 18 * creating version tla@mercurial--convert/tla--test--0
23 19 * imported tla@mercurial--convert/tla--test--0
24 20
25 21 create initial files
26 22
27 23 $ echo 'this is a file' > a
28 24 $ tla add a
29 25 $ mkdir src
30 26 $ tla add src
31 27 $ cd src
32 28 $ dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null
33 29 $ tla add b
34 30 $ tla commit -s "added a file, src and src/b (binary)"
35 31 A/ .arch-ids
36 32 A/ src
37 33 A/ src/.arch-ids
38 34 A .arch-ids/a.id
39 35 A a
40 36 A src/.arch-ids/=id
41 37 A src/.arch-ids/b.id
42 38 A src/b
43 39 * update pristine tree (tla@mercurial--convert/tla--test--0--base-0 => tla--test--0--patch-1)
44 40 * committed tla@mercurial--convert/tla--test--0--patch-1
45 41
46 42 create link file and modify a
47 43
48 44 $ ln -s ../a a-link
49 45 $ tla add a-link
50 46 $ echo 'this a modification to a' >> ../a
51 47 $ tla commit -s "added link to a and modify a"
52 48 A src/.arch-ids/a-link.id
53 49 A src/a-link
54 50 M a
55 51 * update pristine tree (tla@mercurial--convert/tla--test--0--patch-1 => tla--test--0--patch-2)
56 52 * committed tla@mercurial--convert/tla--test--0--patch-2
57 53
58 54 create second link and modify b
59 55
60 56 $ ln -s ../a a-link-2
61 57 $ tla add a-link-2
62 58 $ dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null
63 59 $ tla commit -s "added second link and modify b"
64 60 A src/.arch-ids/a-link-2.id
65 61 A src/a-link-2
66 62 Mb src/b
67 63 * update pristine tree (tla@mercurial--convert/tla--test--0--patch-2 => tla--test--0--patch-3)
68 64 * committed tla@mercurial--convert/tla--test--0--patch-3
69 65
70 66 b file to link and a-link-2 to regular file
71 67
72 68 $ rm -f a-link-2
73 69 $ echo 'this is now a regular file' > a-link-2
74 70 $ ln -sf ../a b
75 71 $ tla commit -s "file to link and link to file test"
76 72 fl src/b
77 73 lf src/a-link-2
78 74 * update pristine tree (tla@mercurial--convert/tla--test--0--patch-3 => tla--test--0--patch-4)
79 75 * committed tla@mercurial--convert/tla--test--0--patch-4
80 76
81 77 move a-link-2 file and src directory
82 78
83 79 $ cd ..
84 80 $ tla mv src/a-link-2 c
85 81 $ tla mv src test
86 82 $ tla commit -s "move and rename a-link-2 file and src directory"
87 83 D/ src/.arch-ids
88 84 A/ test/.arch-ids
89 85 /> src test
90 86 => src/.arch-ids/a-link-2.id .arch-ids/c.id
91 87 => src/a-link-2 c
92 88 => src/.arch-ids/=id test/.arch-ids/=id
93 89 => src/.arch-ids/a-link.id test/.arch-ids/a-link.id
94 90 => src/.arch-ids/b.id test/.arch-ids/b.id
95 91 * update pristine tree (tla@mercurial--convert/tla--test--0--patch-4 => tla--test--0--patch-5)
96 92 * committed tla@mercurial--convert/tla--test--0--patch-5
97 93 $ cd ..
98 94
99 95 converting tla repo to Mercurial
100 96
101 97 $ hg convert tla-repo tla-repo-hg
102 98 initializing destination tla-repo-hg repository
103 99 analyzing tree version tla@mercurial--convert/tla--test--0...
104 100 scanning source...
105 101 sorting...
106 102 converting...
107 103 5 initial import
108 104 4 added a file, src and src/b (binary)
109 105 3 added link to a and modify a
110 106 2 added second link and modify b
111 107 1 file to link and link to file test
112 108 0 move and rename a-link-2 file and src directory
113 109 $ tla register-archive -d tla@mercurial--convert
114 110 $ glog()
115 111 > {
116 112 > hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
117 113 > }
118 114
119 115 show graph log
120 116
121 117 $ glog -R tla-repo-hg
122 118 o 5 "move and rename a-link-2 file and src directory" files: c src/a-link src/a-link-2 src/b test/a-link test/b
123 119 |
124 120 o 4 "file to link and link to file test" files: src/a-link-2 src/b
125 121 |
126 122 o 3 "added second link and modify b" files: src/a-link-2 src/b
127 123 |
128 124 o 2 "added link to a and modify a" files: a src/a-link
129 125 |
130 126 o 1 "added a file, src and src/b (binary)" files: a src/b
131 127 |
132 128 o 0 "initial import" files:
133 129
134 130 $ hg up -q -R tla-repo-hg
135 131 $ hg -R tla-repo-hg manifest --debug
136 132 c4072c4b72e1cabace081888efa148ee80ca3cbb 644 a
137 133 0201ac32a3a8e86e303dff60366382a54b48a72e 644 c
138 134 c0067ba5ff0b7c9a3eb17270839d04614c435623 644 @ test/a-link
139 135 375f4263d86feacdea7e3c27100abd1560f2a973 644 @ test/b
General Comments 0
You need to be logged in to leave comments. Login now