Show More
@@ -1,287 +1,289 | |||||
1 | #require bzr |
|
1 | #require bzr | |
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 | $ brz init -q source |
|
9 | $ brz 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 | $ brz add -q a c e |
|
25 | $ brz add -q a c e | |
26 | $ brz commit -q -m 'Initial add: a, c, e' |
|
26 | $ brz commit -q -m 'Initial add: a, c, e' | |
27 | $ brz mv a b |
|
27 | $ brz mv a b | |
28 | a => b |
|
28 | a => b | |
29 | $ brz mv c d |
|
29 | $ brz mv c d | |
30 | c => d |
|
30 | c => d | |
31 | $ brz mv e f |
|
31 | $ brz mv e f | |
32 | e => f |
|
32 | e => f | |
33 | $ echo a2 >> a |
|
33 | $ echo a2 >> a | |
34 | $ mkdir e |
|
34 | $ mkdir e | |
35 | $ brz add -q a e |
|
35 | $ brz add -q a e | |
36 | $ brz commit -q -m 'rename a into b, create a, rename c into d' |
|
36 | $ brz 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+: [b d f], files-: [c e], files: [a] |
|
45 | o 1@source "rename a into b, create a, rename c into d" files+: [b d f], files-: [c e], files: [a] | |
46 | | |
|
46 | | | |
47 | o 0@source "Initial add: a, c, e" files+: [a c e], files-: [], files: [] |
|
47 | o 0@source "Initial add: a, c, e" files+: [a c e], files-: [], files: [] | |
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], files-: [], files: [] |
|
67 | o 0@source "Initial add: a, c, e" files+: [a c e], files-: [], files: [] | |
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 | $ brz checkout --lightweight source source-light |
|
89 | $ brz 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 | $ brz log | \ |
|
102 | $ brz 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 | $ cmp bzr-timestamps hg-timestamps || diff -u bzr-timestamps hg-timestamps |
|
107 | $ cmp bzr-timestamps hg-timestamps || 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 breezy import workingtree |
|
116 | > from breezy import workingtree | |
117 | > import breezy.bzr.bzrdir |
|
117 | > import breezy.bzr.bzrdir | |
118 | > wt = workingtree.WorkingTree.open('.') |
|
118 | > wt = workingtree.WorkingTree.open('.') | |
119 | > |
|
119 | > | |
120 | > message, stamp = sys.argv[1:] |
|
120 | > message, stamp = sys.argv[1:] | |
121 | > wt.commit(message, timestamp=int(stamp)) |
|
121 | > wt.commit(message, timestamp=int(stamp)) | |
122 | > EOF |
|
122 | > EOF | |
123 | $ brz init -q source |
|
123 | $ brz init -q source | |
124 | $ cd source |
|
124 | $ cd source | |
125 | $ echo content > a |
|
125 | $ echo content > a | |
126 | $ echo content2 > b |
|
126 | $ echo content2 > b | |
127 | $ brz add -q a b |
|
127 | $ brz add -q a b | |
128 | $ brz commit -q -m 'Initial add' |
|
128 | $ brz commit -q -m 'Initial add' | |
129 | $ cd .. |
|
129 | $ cd .. | |
130 | $ brz branch -q source source-improve |
|
130 | $ brz branch -q source source-improve | |
131 | $ cd source |
|
131 | $ cd source | |
132 | $ echo more >> a |
|
132 | $ echo more >> a | |
133 | $ "$PYTHON" ../helper.py 'Editing a' 100 |
|
133 | $ "$PYTHON" ../helper.py 'Editing a' 100 | |
134 | $ cd ../source-improve |
|
134 | $ cd ../source-improve | |
135 | $ echo content3 >> b |
|
135 | $ echo content3 >> b | |
136 | $ "$PYTHON" ../helper.py 'Editing b' 200 |
|
136 | $ "$PYTHON" ../helper.py 'Editing b' 200 | |
137 | $ cd ../source |
|
137 | $ cd ../source | |
138 | $ brz merge -q ../source-improve |
|
138 | $ brz merge -q ../source-improve | |
139 | $ brz commit -q -m 'Merged improve branch' |
|
139 | $ brz commit -q -m 'Merged improve branch' | |
140 | $ cd .. |
|
140 | $ cd .. | |
141 | $ hg convert --datesort source source-hg |
|
141 | $ hg convert --datesort source source-hg | |
142 | initializing destination source-hg repository |
|
142 | initializing destination source-hg repository | |
143 | scanning source... |
|
143 | scanning source... | |
144 | sorting... |
|
144 | sorting... | |
145 | converting... |
|
145 | converting... | |
146 | 3 Initial add |
|
146 | 3 Initial add | |
147 | 2 Editing a |
|
147 | 2 Editing a | |
148 | 1 Editing b |
|
148 | 1 Editing b | |
149 | 0 Merged improve branch |
|
149 | 0 Merged improve branch | |
150 | $ glog -R source-hg |
|
150 | $ glog -R source-hg | |
151 | o 3@source "Merged improve branch" files+: [], files-: [], files: [] |
|
151 | o 3@source "Merged improve branch" files+: [], files-: [], files: [] | |
152 | |\ |
|
152 | |\ | |
153 | | o 2@source-improve "Editing b" files+: [], files-: [], files: [b] |
|
153 | | o 2@source-improve "Editing b" files+: [], files-: [], files: [b] | |
154 | | | |
|
154 | | | | |
155 | o | 1@source "Editing a" files+: [], files-: [], files: [a] |
|
155 | o | 1@source "Editing a" files+: [], files-: [], files: [a] | |
156 | |/ |
|
156 | |/ | |
157 | o 0@source "Initial add" files+: [a b], files-: [], files: [] |
|
157 | o 0@source "Initial add" files+: [a b], files-: [], files: [] | |
158 |
|
158 | |||
159 | $ cd .. |
|
159 | $ cd .. | |
160 |
|
160 | |||
161 | #if symlink execbit |
|
161 | #if symlink execbit | |
162 |
|
162 | |||
163 | symlinks and executable files |
|
163 | symlinks and executable files | |
164 |
|
164 | |||
165 | $ mkdir test-symlinks |
|
165 | $ mkdir test-symlinks | |
166 | $ cd test-symlinks |
|
166 | $ cd test-symlinks | |
167 | $ brz init -q source |
|
167 | $ brz init -q source | |
168 | $ cd source |
|
168 | $ cd source | |
169 | $ touch program |
|
169 | $ touch program | |
170 | $ chmod +x program |
|
170 | $ chmod +x program | |
171 | $ ln -s program altname |
|
171 | $ ln -s program altname | |
172 | $ mkdir d |
|
172 | $ mkdir d | |
173 | $ echo a > d/a |
|
173 | $ echo a > d/a | |
174 | $ ln -s a syma |
|
174 | $ ln -s a syma | |
175 | $ brz add -q altname program syma d/a |
|
175 | $ brz add -q altname program syma d/a | |
176 | $ brz commit -q -m 'Initial setup' |
|
176 | $ brz commit -q -m 'Initial setup' | |
177 | $ touch newprog |
|
177 | $ touch newprog | |
178 | $ chmod +x newprog |
|
178 | $ chmod +x newprog | |
179 | $ rm altname |
|
179 | $ rm altname | |
180 | $ ln -s newprog altname |
|
180 | $ ln -s newprog altname | |
181 | $ chmod -x program |
|
181 | $ chmod -x program | |
182 | $ brz add -q newprog |
|
182 | $ brz add -q newprog | |
183 | $ brz commit -q -m 'Symlink changed, x bits changed' |
|
183 | $ brz commit -q -m 'Symlink changed, x bits changed' | |
184 | $ cd .. |
|
184 | $ cd .. | |
185 | $ hg convert source source-hg |
|
185 | $ hg convert source source-hg | |
186 | initializing destination source-hg repository |
|
186 | initializing destination source-hg repository | |
187 | scanning source... |
|
187 | scanning source... | |
188 | sorting... |
|
188 | sorting... | |
189 | converting... |
|
189 | converting... | |
190 | 1 Initial setup |
|
190 | 1 Initial setup | |
191 | 0 Symlink changed, x bits changed |
|
191 | 0 Symlink changed, x bits changed | |
192 | $ manifest source-hg 0 |
|
192 | $ manifest source-hg 0 | |
193 | % manifest of 0 |
|
193 | % manifest of 0 | |
194 | 644 @ altname |
|
194 | 644 @ altname | |
195 | 644 d/a |
|
195 | 644 d/a | |
196 | 755 * program |
|
196 | 755 * program | |
197 | 644 @ syma |
|
197 | 644 @ syma | |
198 | $ manifest source-hg tip |
|
198 | $ manifest source-hg tip | |
199 | % manifest of tip |
|
199 | % manifest of tip | |
200 | 644 @ altname |
|
200 | 644 @ altname | |
201 | 644 d/a |
|
201 | 644 d/a | |
202 | 755 * newprog |
|
202 | 755 * newprog | |
203 | 644 program |
|
203 | 644 program | |
204 | 644 @ syma |
|
204 | 644 @ syma | |
205 |
|
205 | |||
206 | test the symlinks can be recreated |
|
206 | test the symlinks can be recreated | |
207 |
|
207 | |||
208 | $ cd source-hg |
|
208 | $ cd source-hg | |
209 | $ hg up |
|
209 | $ hg up | |
210 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
210 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
211 | $ hg cat syma; echo |
|
211 | $ hg cat syma; echo | |
212 | a |
|
212 | a | |
213 | $ cd ../.. |
|
213 | $ cd ../.. | |
214 |
|
214 | |||
215 | #endif |
|
215 | #endif | |
216 |
|
216 | |||
217 | Multiple branches |
|
217 | Multiple branches | |
218 |
|
218 | |||
219 | $ brz init-repo -q --no-trees repo |
|
219 | $ brz init-repo -q --no-trees repo | |
220 | $ brz init -q repo/trunk |
|
220 | $ brz init -q repo/trunk | |
221 | $ brz co repo/trunk repo-trunk |
|
221 | $ brz co repo/trunk repo-trunk | |
222 | $ cd repo-trunk |
|
222 | $ cd repo-trunk | |
223 | $ echo a > a |
|
223 | $ echo a > a | |
224 | $ brz add -q a |
|
224 | $ brz add -q a | |
|
225 | $ sleep 1 # help with sorting | |||
225 | $ brz ci -qm adda |
|
226 | $ brz ci -qm adda | |
226 | $ brz tag trunk-tag |
|
227 | $ brz tag trunk-tag | |
227 | Created tag trunk-tag. |
|
228 | Created tag trunk-tag. | |
228 | $ brz switch -b branch |
|
229 | $ brz switch -b branch | |
229 | Tree is up to date at revision 1. |
|
230 | Tree is up to date at revision 1. | |
230 | Switched to branch*repo/branch/ (glob) |
|
231 | Switched to branch*repo/branch/ (glob) | |
231 | $ echo b > b |
|
232 | $ echo b > b | |
232 | $ brz add -q b |
|
233 | $ brz add -q b | |
233 | $ brz ci -qm addb |
|
234 | $ brz ci -qm addb | |
234 | $ brz tag branch-tag |
|
235 | $ brz tag branch-tag | |
235 | Created tag branch-tag. |
|
236 | Created tag branch-tag. | |
236 | $ brz switch --force ../repo/trunk |
|
237 | $ brz switch --force ../repo/trunk | |
237 | Updated to revision 1. |
|
238 | Updated to revision 1. | |
238 | Switched to branch*/repo/trunk/ (glob) |
|
239 | Switched to branch*/repo/trunk/ (glob) | |
239 | $ echo a >> a |
|
240 | $ echo a >> a | |
|
241 | $ sleep 1 # help with sorting | |||
240 | $ brz ci -qm changea |
|
242 | $ brz ci -qm changea | |
241 | $ cd .. |
|
243 | $ cd .. | |
242 | $ hg convert --datesort repo repo-bzr |
|
244 | $ hg convert --datesort repo repo-bzr | |
243 | initializing destination repo-bzr repository |
|
245 | initializing destination repo-bzr repository | |
244 | scanning source... |
|
246 | scanning source... | |
245 | sorting... |
|
247 | sorting... | |
246 | converting... |
|
248 | converting... | |
247 | 2 adda |
|
249 | 2 adda | |
248 | 1 addb |
|
250 | 1 addb | |
249 | 0 changea |
|
251 | 0 changea | |
250 | updating tags |
|
252 | updating tags | |
251 | $ (cd repo-bzr; glog) |
|
253 | $ (cd repo-bzr; glog) | |
252 | o 3@default "update tags" files+: [.hgtags], files-: [], files: [] |
|
254 | o 3@default "update tags" files+: [.hgtags], files-: [], files: [] | |
253 | | |
|
255 | | | |
254 | o 2@default "changea" files+: [], files-: [], files: [a] |
|
256 | o 2@default "changea" files+: [], files-: [], files: [a] | |
255 | | |
|
257 | | | |
256 | | o 1@branch "addb" files+: [b], files-: [], files: [] |
|
258 | | o 1@branch "addb" files+: [b], files-: [], files: [] | |
257 | |/ |
|
259 | |/ | |
258 | o 0@default "adda" files+: [a], files-: [], files: [] |
|
260 | o 0@default "adda" files+: [a], files-: [], files: [] | |
259 |
|
261 | |||
260 |
|
262 | |||
261 | Test tags (converted identifiers are not stable because bzr ones are |
|
263 | Test tags (converted identifiers are not stable because bzr ones are | |
262 | not and get incorporated in extra fields). |
|
264 | not and get incorporated in extra fields). | |
263 |
|
265 | |||
264 | $ hg -R repo-bzr tags |
|
266 | $ hg -R repo-bzr tags | |
265 | tip 3:* (glob) |
|
267 | tip 3:* (glob) | |
266 | branch-tag 1:* (glob) |
|
268 | branch-tag 1:* (glob) | |
267 | trunk-tag 0:* (glob) |
|
269 | trunk-tag 0:* (glob) | |
268 |
|
270 | |||
269 | Nested repositories (issue3254) |
|
271 | Nested repositories (issue3254) | |
270 |
|
272 | |||
271 | $ brz init-repo -q --no-trees repo/inner |
|
273 | $ brz init-repo -q --no-trees repo/inner | |
272 | $ brz init -q repo/inner/trunk |
|
274 | $ brz init -q repo/inner/trunk | |
273 | $ brz co repo/inner/trunk inner-trunk |
|
275 | $ brz co repo/inner/trunk inner-trunk | |
274 | $ cd inner-trunk |
|
276 | $ cd inner-trunk | |
275 | $ echo b > b |
|
277 | $ echo b > b | |
276 | $ brz add -q b |
|
278 | $ brz add -q b | |
277 | $ brz ci -qm addb |
|
279 | $ brz ci -qm addb | |
278 | $ cd .. |
|
280 | $ cd .. | |
279 | $ hg convert --datesort repo noinner-bzr |
|
281 | $ hg convert --datesort repo noinner-bzr | |
280 | initializing destination noinner-bzr repository |
|
282 | initializing destination noinner-bzr repository | |
281 | scanning source... |
|
283 | scanning source... | |
282 | sorting... |
|
284 | sorting... | |
283 | converting... |
|
285 | converting... | |
284 | 2 adda |
|
286 | 2 adda | |
285 | 1 addb |
|
287 | 1 addb | |
286 | 0 changea |
|
288 | 0 changea | |
287 | updating tags |
|
289 | updating tags |
General Comments 0
You need to be logged in to leave comments.
Login now