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