##// END OF EJS Templates
tests: make test-convert-bzr.t more stable...
Mads Kiilerich -
r17097:885542e7 default
parent child Browse files
Show More
@@ -1,284 +1,286 b''
1 1 $ . "$TESTDIR/bzr-definitions"
2 2
3 3 create and rename on the same file in the same step
4 4
5 5 $ mkdir test-createandrename
6 6 $ cd test-createandrename
7 7 $ bzr init -q source
8 8
9 9 test empty repo conversion (issue3233)
10 10
11 11 $ hg convert source source-hg
12 12 initializing destination source-hg repository
13 13 scanning source...
14 14 sorting...
15 15 converting...
16 16
17 17 back to the rename stuff
18 18
19 19 $ cd source
20 20 $ echo a > a
21 21 $ echo c > c
22 22 $ echo e > e
23 23 $ bzr add -q a c e
24 24 $ bzr commit -q -m 'Initial add: a, c, e'
25 25 $ bzr mv a b
26 26 a => b
27 27 $ bzr mv c d
28 28 c => d
29 29 $ bzr mv e f
30 30 e => f
31 31 $ echo a2 >> a
32 32 $ mkdir e
33 33 $ bzr add -q a e
34 34 $ bzr commit -q -m 'rename a into b, create a, rename c into d'
35 35 $ cd ..
36 36 $ hg convert source source-hg
37 37 scanning source...
38 38 sorting...
39 39 converting...
40 40 1 Initial add: a, c, e
41 41 0 rename a into b, create a, rename c into d
42 42 $ glog -R source-hg
43 43 o 1@source "rename a into b, create a, rename c into d" files: a b c d e f
44 44 |
45 45 o 0@source "Initial add: a, c, e" files: a c e
46 46
47 47
48 48 manifest
49 49
50 50 $ hg manifest -R source-hg -r tip
51 51 a
52 52 b
53 53 d
54 54 f
55 55
56 56 test --rev option
57 57
58 58 $ hg convert -r 1 source source-1-hg
59 59 initializing destination source-1-hg repository
60 60 scanning source...
61 61 sorting...
62 62 converting...
63 63 0 Initial add: a, c, e
64 64 $ glog -R source-1-hg
65 65 o 0@source "Initial add: a, c, e" files: a c e
66 66
67 67
68 68 test with filemap
69 69
70 70 $ cat > filemap <<EOF
71 71 > exclude a
72 72 > EOF
73 73 $ hg convert --filemap filemap source source-filemap-hg
74 74 initializing destination source-filemap-hg repository
75 75 scanning source...
76 76 sorting...
77 77 converting...
78 78 1 Initial add: a, c, e
79 79 0 rename a into b, create a, rename c into d
80 80 $ hg -R source-filemap-hg manifest -r tip
81 81 b
82 82 d
83 83 f
84 84
85 85 convert from lightweight checkout
86 86
87 87 $ bzr checkout --lightweight source source-light
88 88 $ hg convert -s bzr source-light source-light-hg
89 89 initializing destination source-light-hg repository
90 90 warning: lightweight checkouts may cause conversion failures, try with a regular branch instead.
91 91 $TESTTMP/test-createandrename/source-light does not look like a Bazaar repository
92 92 abort: source-light: missing or unsupported repository
93 93 [255]
94 94
95 95 extract timestamps that look just like hg's {date|isodate}:
96 96 yyyy-mm-dd HH:MM zzzz (no seconds!)
97 97 compare timestamps
98 98
99 99 $ cd source
100 100 $ bzr log | \
101 101 > sed '/timestamp/!d;s/.\{15\}\([0-9: -]\{16\}\):.. \(.[0-9]\{4\}\)/\1 \2/' \
102 102 > > ../bzr-timestamps
103 103 $ cd ..
104 104 $ hg -R source-hg log --template "{date|isodate}\n" > hg-timestamps
105 105 $ diff -u bzr-timestamps hg-timestamps
106 106 $ cd ..
107 107
108 108 merge
109 109
110 110 $ mkdir test-merge
111 111 $ cd test-merge
112 112 $ cat > helper.py <<EOF
113 113 > import sys
114 114 > from bzrlib import workingtree
115 115 > wt = workingtree.WorkingTree.open('.')
116 116 >
117 117 > message, stamp = sys.argv[1:]
118 118 > wt.commit(message, timestamp=int(stamp))
119 119 > EOF
120 120 $ bzr init -q source
121 121 $ cd source
122 122 $ echo content > a
123 123 $ echo content2 > b
124 124 $ bzr add -q a b
125 125 $ bzr commit -q -m 'Initial add'
126 126 $ cd ..
127 127 $ bzr branch -q source source-improve
128 128 $ cd source
129 129 $ echo more >> a
130 130 $ python ../helper.py 'Editing a' 100
131 131 $ cd ../source-improve
132 132 $ echo content3 >> b
133 133 $ python ../helper.py 'Editing b' 200
134 134 $ cd ../source
135 135 $ bzr merge -q ../source-improve
136 136 $ bzr commit -q -m 'Merged improve branch'
137 137 $ cd ..
138 138 $ hg convert --datesort source source-hg
139 139 initializing destination source-hg repository
140 140 scanning source...
141 141 sorting...
142 142 converting...
143 143 3 Initial add
144 144 2 Editing a
145 145 1 Editing b
146 146 0 Merged improve branch
147 147 $ glog -R source-hg
148 148 o 3@source "Merged improve branch" files:
149 149 |\
150 150 | o 2@source-improve "Editing b" files: b
151 151 | |
152 152 o | 1@source "Editing a" files: a
153 153 |/
154 154 o 0@source "Initial add" files: a b
155 155
156 156 $ cd ..
157 157
158 158 #if symlink execbit
159 159
160 160 symlinks and executable files
161 161
162 162 $ mkdir test-symlinks
163 163 $ cd test-symlinks
164 164 $ bzr init -q source
165 165 $ cd source
166 166 $ touch program
167 167 $ chmod +x program
168 168 $ ln -s program altname
169 169 $ mkdir d
170 170 $ echo a > d/a
171 171 $ ln -s a syma
172 172 $ bzr add -q altname program syma d/a
173 173 $ bzr commit -q -m 'Initial setup'
174 174 $ touch newprog
175 175 $ chmod +x newprog
176 176 $ rm altname
177 177 $ ln -s newprog altname
178 178 $ chmod -x program
179 179 $ bzr add -q newprog
180 180 $ bzr commit -q -m 'Symlink changed, x bits changed'
181 181 $ cd ..
182 182 $ hg convert source source-hg
183 183 initializing destination source-hg repository
184 184 scanning source...
185 185 sorting...
186 186 converting...
187 187 1 Initial setup
188 188 0 Symlink changed, x bits changed
189 189 $ manifest source-hg 0
190 190 % manifest of 0
191 191 644 @ altname
192 192 644 d/a
193 193 755 * program
194 194 644 @ syma
195 195 $ manifest source-hg tip
196 196 % manifest of tip
197 197 644 @ altname
198 198 644 d/a
199 199 755 * newprog
200 200 644 program
201 201 644 @ syma
202 202
203 203 test the symlinks can be recreated
204 204
205 205 $ cd source-hg
206 206 $ hg up
207 207 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
208 208 $ hg cat syma; echo
209 209 a
210 210 $ cd ../..
211 211
212 212 #endif
213 213
214 214 Multiple branches
215 215
216 216 $ bzr init-repo -q --no-trees repo
217 217 $ bzr init -q repo/trunk
218 218 $ bzr co repo/trunk repo-trunk
219 219 $ cd repo-trunk
220 220 $ echo a > a
221 221 $ bzr add -q a
222 222 $ bzr ci -qm adda
223 223 $ bzr tag trunk-tag
224 224 Created tag trunk-tag.
225 225 $ bzr switch -b branch
226 226 Tree is up to date at revision 1.
227 227 Switched to branch: *repo/branch/ (glob)
228 $ sleep 1
228 229 $ echo b > b
229 230 $ bzr add -q b
230 231 $ bzr ci -qm addb
231 232 $ bzr tag branch-tag
232 233 Created tag branch-tag.
233 234 $ bzr switch --force ../repo/trunk
234 235 Updated to revision 1.
235 236 Switched to branch: */repo/trunk/ (glob)
237 $ sleep 1
236 238 $ echo a >> a
237 239 $ bzr ci -qm changea
238 240 $ cd ..
239 241 $ hg convert --datesort repo repo-bzr
240 242 initializing destination repo-bzr repository
241 243 scanning source...
242 244 sorting...
243 245 converting...
244 246 2 adda
245 247 1 addb
246 248 0 changea
247 249 updating tags
248 250 $ (cd repo-bzr; glog)
249 251 o 3@default "update tags" files: .hgtags
250 252 |
251 253 o 2@default "changea" files: a
252 254 |
253 255 | o 1@branch "addb" files: b
254 256 |/
255 257 o 0@default "adda" files: a
256 258
257 259
258 260 Test tags (converted identifiers are not stable because bzr ones are
259 261 not and get incorporated in extra fields).
260 262
261 263 $ hg -R repo-bzr tags
262 264 tip 3:* (glob)
263 265 branch-tag 1:* (glob)
264 266 trunk-tag 0:* (glob)
265 267
266 268 Nested repositories (issue3254)
267 269
268 270 $ bzr init-repo -q --no-trees repo/inner
269 271 $ bzr init -q repo/inner/trunk
270 272 $ bzr co repo/inner/trunk inner-trunk
271 273 $ cd inner-trunk
272 274 $ echo b > b
273 275 $ bzr add -q b
274 276 $ bzr ci -qm addb
275 277 $ cd ..
276 278 $ hg convert --datesort repo noinner-bzr
277 279 initializing destination noinner-bzr repository
278 280 scanning source...
279 281 sorting...
280 282 converting...
281 283 2 adda
282 284 1 addb
283 285 0 changea
284 286 updating tags
General Comments 0
You need to be logged in to leave comments. Login now