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