##// END OF EJS Templates
Merge with crew
Brendan Cully -
r7511:f43a8b0c merge default
parent child Browse files
Show More
@@ -0,0 +1,415 b''
1 SVN-fs-dump-format-version: 2
2
3 UUID: 7b60030a-5a1f-4344-a009-73f0c1c2adf2
4
5 Revision-number: 0
6 Prop-content-length: 56
7 Content-length: 56
8
9 K 8
10 svn:date
11 V 27
12 2008-12-06T12:47:52.296168Z
13 PROPS-END
14
15 Revision-number: 1
16 Prop-content-length: 112
17 Content-length: 112
18
19 K 7
20 svn:log
21 V 10
22 init projA
23 K 10
24 svn:author
25 V 7
26 pmezard
27 K 8
28 svn:date
29 V 27
30 2008-12-06T12:47:52.342238Z
31 PROPS-END
32
33 Node-path: branches
34 Node-kind: dir
35 Node-action: add
36 Prop-content-length: 10
37 Content-length: 10
38
39 PROPS-END
40
41
42 Node-path: tags
43 Node-kind: dir
44 Node-action: add
45 Prop-content-length: 10
46 Content-length: 10
47
48 PROPS-END
49
50
51 Node-path: trunk
52 Node-kind: dir
53 Node-action: add
54 Prop-content-length: 10
55 Content-length: 10
56
57 PROPS-END
58
59
60 Revision-number: 2
61 Prop-content-length: 106
62 Content-length: 106
63
64 K 7
65 svn:log
66 V 5
67 hello
68 K 10
69 svn:author
70 V 7
71 pmezard
72 K 8
73 svn:date
74 V 27
75 2008-12-06T12:47:53.190046Z
76 PROPS-END
77
78 Node-path: branches/notinbranch
79 Node-kind: file
80 Node-action: add
81 Prop-content-length: 10
82 Text-content-length: 2
83 Text-content-md5: e29311f6f1bf1af907f9ef9f44b8328b
84 Content-length: 12
85
86 PROPS-END
87 d
88
89
90 Node-path: trunk/a
91 Node-kind: file
92 Node-action: add
93 Prop-content-length: 10
94 Text-content-length: 2
95 Text-content-md5: 60b725f10c9c85c70d97880dfe8191b3
96 Content-length: 12
97
98 PROPS-END
99 a
100
101
102 Node-path: trunk/b
103 Node-kind: file
104 Node-action: add
105 Prop-content-length: 10
106 Text-content-length: 2
107 Text-content-md5: 3b5d5c3712955042212316173ccf37be
108 Content-length: 12
109
110 PROPS-END
111 b
112
113
114 Node-path: trunk/c
115 Node-kind: file
116 Node-action: add
117 Prop-content-length: 10
118 Text-content-length: 2
119 Text-content-md5: 2cd6ee2c70b0bde53fbe6cac3c8b8bb1
120 Content-length: 12
121
122 PROPS-END
123 c
124
125
126 Revision-number: 3
127 Prop-content-length: 124
128 Content-length: 124
129
130 K 7
131 svn:log
132 V 22
133 branch trunk, remove c
134 K 10
135 svn:author
136 V 7
137 pmezard
138 K 8
139 svn:date
140 V 27
141 2008-12-06T12:47:55.188535Z
142 PROPS-END
143
144 Node-path: branches/old
145 Node-kind: dir
146 Node-action: add
147 Node-copyfrom-rev: 1
148 Node-copyfrom-path: trunk
149 Prop-content-length: 34
150 Content-length: 34
151
152 K 13
153 svn:mergeinfo
154 V 0
155
156 PROPS-END
157
158
159 Node-path: branches/old/a
160 Node-kind: file
161 Node-action: add
162 Node-copyfrom-rev: 2
163 Node-copyfrom-path: trunk/a
164 Text-copy-source-md5: 60b725f10c9c85c70d97880dfe8191b3
165
166
167 Node-path: branches/old/b
168 Node-kind: file
169 Node-action: add
170 Node-copyfrom-rev: 2
171 Node-copyfrom-path: trunk/b
172 Text-copy-source-md5: 3b5d5c3712955042212316173ccf37be
173
174
175 Revision-number: 4
176 Prop-content-length: 109
177 Content-length: 109
178
179 K 7
180 svn:log
181 V 8
182 change a
183 K 10
184 svn:author
185 V 7
186 pmezard
187 K 8
188 svn:date
189 V 27
190 2008-12-06T12:47:57.146347Z
191 PROPS-END
192
193 Node-path: trunk/a
194 Node-kind: file
195 Node-action: change
196 Text-content-length: 4
197 Text-content-md5: 0d227f1abf8c2932d342e9b99cc957eb
198 Content-length: 4
199
200 a
201 a
202
203
204 Revision-number: 5
205 Prop-content-length: 109
206 Content-length: 109
207
208 K 7
209 svn:log
210 V 8
211 change b
212 K 10
213 svn:author
214 V 7
215 pmezard
216 K 8
217 svn:date
218 V 27
219 2008-12-06T12:47:58.150124Z
220 PROPS-END
221
222 Node-path: branches/old/b
223 Node-kind: file
224 Node-action: change
225 Text-content-length: 4
226 Text-content-md5: 06ac26ed8b614fc0b141e4542aa067c2
227 Content-length: 4
228
229 b
230 b
231
232
233 Revision-number: 6
234 Prop-content-length: 119
235 Content-length: 119
236
237 K 7
238 svn:log
239 V 17
240 move and update c
241 K 10
242 svn:author
243 V 7
244 pmezard
245 K 8
246 svn:date
247 V 27
248 2008-12-06T12:48:00.161336Z
249 PROPS-END
250
251 Node-path: branches/old/c
252 Node-kind: file
253 Node-action: add
254 Node-copyfrom-rev: 3
255 Node-copyfrom-path: trunk/b
256 Text-copy-source-md5: 3b5d5c3712955042212316173ccf37be
257 Prop-content-length: 34
258 Text-content-length: 4
259 Text-content-md5: 33cb6785d50937d8d307ebb66d6259a7
260 Content-length: 38
261
262 K 13
263 svn:mergeinfo
264 V 0
265
266 PROPS-END
267 b
268 c
269
270
271 Node-path: trunk/b
272 Node-action: delete
273
274
275 Revision-number: 7
276 Prop-content-length: 116
277 Content-length: 116
278
279 K 7
280 svn:log
281 V 14
282 change b again
283 K 10
284 svn:author
285 V 7
286 pmezard
287 K 8
288 svn:date
289 V 27
290 2008-12-06T12:48:01.153724Z
291 PROPS-END
292
293 Node-path: branches/old/b
294 Node-kind: file
295 Node-action: change
296 Text-content-length: 6
297 Text-content-md5: cdcfb41554e2d092c13f5e6839e63577
298 Content-length: 6
299
300 b
301 b
302 b
303
304
305 Revision-number: 8
306 Prop-content-length: 114
307 Content-length: 114
308
309 K 7
310 svn:log
311 V 12
312 move to old2
313 K 10
314 svn:author
315 V 7
316 pmezard
317 K 8
318 svn:date
319 V 27
320 2008-12-06T12:48:04.150915Z
321 PROPS-END
322
323 Node-path: branches/old2
324 Node-kind: dir
325 Node-action: add
326 Node-copyfrom-rev: 7
327 Node-copyfrom-path: branches/old
328
329
330 Node-path: branches/old
331 Node-action: delete
332
333
334 Revision-number: 9
335 Prop-content-length: 118
336 Content-length: 118
337
338 K 7
339 svn:log
340 V 16
341 move back to old
342 K 10
343 svn:author
344 V 7
345 pmezard
346 K 8
347 svn:date
348 V 27
349 2008-12-06T12:48:06.149560Z
350 PROPS-END
351
352 Node-path: branches/old
353 Node-kind: dir
354 Node-action: add
355 Node-copyfrom-rev: 8
356 Node-copyfrom-path: branches/old2
357
358
359 Node-path: branches/old2
360 Node-action: delete
361
362
363 Revision-number: 10
364 Prop-content-length: 118
365 Content-length: 118
366
367 K 7
368 svn:log
369 V 16
370 last change to a
371 K 10
372 svn:author
373 V 7
374 pmezard
375 K 8
376 svn:date
377 V 27
378 2008-12-06T12:48:07.268498Z
379 PROPS-END
380
381 Node-path: trunk/a
382 Node-kind: file
383 Node-action: change
384 Text-content-length: 2
385 Text-content-md5: 60b725f10c9c85c70d97880dfe8191b3
386 Content-length: 2
387
388 a
389
390
391 Revision-number: 11
392 Prop-content-length: 126
393 Content-length: 126
394
395 K 7
396 svn:log
397 V 24
398 branch trunk@1 into old3
399 K 10
400 svn:author
401 V 7
402 pmezard
403 K 8
404 svn:date
405 V 27
406 2008-12-06T12:48:09.151702Z
407 PROPS-END
408
409 Node-path: branches/old3
410 Node-kind: dir
411 Node-action: add
412 Node-copyfrom-rev: 1
413 Node-copyfrom-path: trunk
414
415
@@ -0,0 +1,401 b''
1 SVN-fs-dump-format-version: 2
2
3 UUID: 0682b859-320d-4a69-a164-a7cab5695072
4
5 Revision-number: 0
6 Prop-content-length: 56
7 Content-length: 56
8
9 K 8
10 svn:date
11 V 27
12 2008-12-06T13:33:36.768573Z
13 PROPS-END
14
15 Revision-number: 1
16 Prop-content-length: 112
17 Content-length: 112
18
19 K 7
20 svn:log
21 V 10
22 init projA
23 K 10
24 svn:author
25 V 7
26 pmezard
27 K 8
28 svn:date
29 V 27
30 2008-12-06T13:33:37.083146Z
31 PROPS-END
32
33 Node-path: trunk
34 Node-kind: dir
35 Node-action: add
36 Prop-content-length: 10
37 Content-length: 10
38
39 PROPS-END
40
41
42 Node-path: trunk/a
43 Node-kind: file
44 Node-action: add
45 Prop-content-length: 10
46 Text-content-length: 2
47 Text-content-md5: 60b725f10c9c85c70d97880dfe8191b3
48 Content-length: 12
49
50 PROPS-END
51 a
52
53
54 Node-path: trunk/d1
55 Node-kind: dir
56 Node-action: add
57 Prop-content-length: 10
58 Content-length: 10
59
60 PROPS-END
61
62
63 Node-path: trunk/d1/b
64 Node-kind: file
65 Node-action: add
66 Prop-content-length: 10
67 Text-content-length: 2
68 Text-content-md5: 3b5d5c3712955042212316173ccf37be
69 Content-length: 12
70
71 PROPS-END
72 b
73
74
75 Node-path: trunk/d1/c
76 Node-kind: file
77 Node-action: add
78 Prop-content-length: 10
79 Text-content-length: 2
80 Text-content-md5: 2cd6ee2c70b0bde53fbe6cac3c8b8bb1
81 Content-length: 12
82
83 PROPS-END
84 c
85
86
87 Node-path: trunk/d2
88 Node-kind: dir
89 Node-action: add
90 Prop-content-length: 10
91 Content-length: 10
92
93 PROPS-END
94
95
96 Node-path: trunk/d2/d
97 Node-kind: file
98 Node-action: add
99 Prop-content-length: 10
100 Text-content-length: 2
101 Text-content-md5: e29311f6f1bf1af907f9ef9f44b8328b
102 Content-length: 12
103
104 PROPS-END
105 d
106
107
108 Revision-number: 2
109 Prop-content-length: 118
110 Content-length: 118
111
112 K 7
113 svn:log
114 V 16
115 commitbeforemove
116 K 10
117 svn:author
118 V 7
119 pmezard
120 K 8
121 svn:date
122 V 27
123 2008-12-06T13:33:38.152773Z
124 PROPS-END
125
126 Node-path: trunk/a
127 Node-kind: file
128 Node-action: change
129 Text-content-length: 4
130 Text-content-md5: 0d227f1abf8c2932d342e9b99cc957eb
131 Content-length: 4
132
133 a
134 a
135
136
137 Node-path: trunk/d1/c
138 Node-kind: file
139 Node-action: change
140 Text-content-length: 4
141 Text-content-md5: 63fad9092ad37713ebe26b3193f89c41
142 Content-length: 4
143
144 c
145 c
146
147
148 Revision-number: 3
149 Prop-content-length: 112
150 Content-length: 112
151
152 K 7
153 svn:log
154 V 10
155 movedtrunk
156 K 10
157 svn:author
158 V 7
159 pmezard
160 K 8
161 svn:date
162 V 27
163 2008-12-06T13:33:39.146388Z
164 PROPS-END
165
166 Node-path: subproject
167 Node-kind: dir
168 Node-action: add
169 Node-copyfrom-rev: 2
170 Node-copyfrom-path: trunk
171
172
173 Node-path: trunk
174 Node-action: delete
175
176
177 Revision-number: 4
178 Prop-content-length: 113
179 Content-length: 113
180
181 K 7
182 svn:log
183 V 11
184 createtrunk
185 K 10
186 svn:author
187 V 7
188 pmezard
189 K 8
190 svn:date
191 V 27
192 2008-12-06T13:33:40.179944Z
193 PROPS-END
194
195 Node-path: subproject/trunk
196 Node-kind: dir
197 Node-action: add
198 Prop-content-length: 10
199 Content-length: 10
200
201 PROPS-END
202
203
204 Revision-number: 5
205 Prop-content-length: 116
206 Content-length: 116
207
208 K 7
209 svn:log
210 V 14
211 createbranches
212 K 10
213 svn:author
214 V 7
215 pmezard
216 K 8
217 svn:date
218 V 27
219 2008-12-06T13:33:41.184505Z
220 PROPS-END
221
222 Node-path: subproject/branches
223 Node-kind: dir
224 Node-action: add
225 Prop-content-length: 10
226 Content-length: 10
227
228 PROPS-END
229
230
231 Revision-number: 6
232 Prop-content-length: 107
233 Content-length: 107
234
235 K 7
236 svn:log
237 V 6
238 moved1
239 K 10
240 svn:author
241 V 7
242 pmezard
243 K 8
244 svn:date
245 V 27
246 2008-12-06T13:33:42.153312Z
247 PROPS-END
248
249 Node-path: subproject/trunk/d1
250 Node-kind: dir
251 Node-action: add
252 Node-copyfrom-rev: 5
253 Node-copyfrom-path: subproject/d1
254
255
256 Node-path: subproject/d1
257 Node-action: delete
258
259
260 Revision-number: 7
261 Prop-content-length: 107
262 Content-length: 107
263
264 K 7
265 svn:log
266 V 6
267 moved2
268 K 10
269 svn:author
270 V 7
271 pmezard
272 K 8
273 svn:date
274 V 27
275 2008-12-06T13:33:42.206313Z
276 PROPS-END
277
278 Node-path: subproject/trunk/d2
279 Node-kind: dir
280 Node-action: add
281 Node-copyfrom-rev: 6
282 Node-copyfrom-path: subproject/d2
283
284
285 Node-path: subproject/d2
286 Node-action: delete
287
288
289 Revision-number: 8
290 Prop-content-length: 119
291 Content-length: 119
292
293 K 7
294 svn:log
295 V 17
296 changeb and rm d2
297 K 10
298 svn:author
299 V 7
300 pmezard
301 K 8
302 svn:date
303 V 27
304 2008-12-06T13:33:43.182355Z
305 PROPS-END
306
307 Node-path: subproject/trunk/d1/b
308 Node-kind: file
309 Node-action: change
310 Text-content-length: 4
311 Text-content-md5: 06ac26ed8b614fc0b141e4542aa067c2
312 Content-length: 4
313
314 b
315 b
316
317
318 Node-path: subproject/trunk/d2
319 Node-action: delete
320
321
322 Revision-number: 9
323 Prop-content-length: 113
324 Content-length: 113
325
326 K 7
327 svn:log
328 V 11
329 moved1again
330 K 10
331 svn:author
332 V 7
333 pmezard
334 K 8
335 svn:date
336 V 27
337 2008-12-06T13:33:44.153682Z
338 PROPS-END
339
340 Node-path: subproject/branches/d1
341 Node-kind: dir
342 Node-action: add
343 Node-copyfrom-rev: 8
344 Node-copyfrom-path: subproject/trunk/d1
345
346
347 Node-path: subproject/trunk/d1
348 Node-action: delete
349
350
351 Revision-number: 10
352 Prop-content-length: 118
353 Content-length: 118
354
355 K 7
356 svn:log
357 V 16
358 copyfilefrompast
359 K 10
360 svn:author
361 V 7
362 pmezard
363 K 8
364 svn:date
365 V 27
366 2008-12-06T13:33:44.298011Z
367 PROPS-END
368
369 Node-path: subproject/trunk/d
370 Node-kind: file
371 Node-action: add
372 Node-copyfrom-rev: 7
373 Node-copyfrom-path: subproject/trunk/d2/d
374 Text-copy-source-md5: e29311f6f1bf1af907f9ef9f44b8328b
375
376
377 Revision-number: 11
378 Prop-content-length: 117
379 Content-length: 117
380
381 K 7
382 svn:log
383 V 15
384 copydirfrompast
385 K 10
386 svn:author
387 V 7
388 pmezard
389 K 8
390 svn:date
391 V 27
392 2008-12-06T13:33:44.349920Z
393 PROPS-END
394
395 Node-path: subproject/trunk/d2
396 Node-kind: dir
397 Node-action: add
398 Node-copyfrom-rev: 7
399 Node-copyfrom-path: subproject/trunk/d2
400
401
@@ -0,0 +1,240 b''
1 SVN-fs-dump-format-version: 2
2
3 UUID: c731c652-65e9-4325-a17e-fed96a319f22
4
5 Revision-number: 0
6 Prop-content-length: 56
7 Content-length: 56
8
9 K 8
10 svn:date
11 V 27
12 2008-12-06T13:44:21.642421Z
13 PROPS-END
14
15 Revision-number: 1
16 Prop-content-length: 112
17 Content-length: 112
18
19 K 7
20 svn:log
21 V 10
22 init projA
23 K 10
24 svn:author
25 V 7
26 pmezard
27 K 8
28 svn:date
29 V 27
30 2008-12-06T13:44:21.759281Z
31 PROPS-END
32
33 Node-path: branches
34 Node-kind: dir
35 Node-action: add
36 Prop-content-length: 10
37 Content-length: 10
38
39 PROPS-END
40
41
42 Node-path: tags
43 Node-kind: dir
44 Node-action: add
45 Prop-content-length: 10
46 Content-length: 10
47
48 PROPS-END
49
50
51 Node-path: trunk
52 Node-kind: dir
53 Node-action: add
54 Prop-content-length: 10
55 Content-length: 10
56
57 PROPS-END
58
59
60 Revision-number: 2
61 Prop-content-length: 109
62 Content-length: 109
63
64 K 7
65 svn:log
66 V 8
67 createab
68 K 10
69 svn:author
70 V 7
71 pmezard
72 K 8
73 svn:date
74 V 27
75 2008-12-06T13:44:22.179257Z
76 PROPS-END
77
78 Node-path: trunk/a
79 Node-kind: file
80 Node-action: add
81 Prop-content-length: 10
82 Text-content-length: 2
83 Text-content-md5: 60b725f10c9c85c70d97880dfe8191b3
84 Content-length: 12
85
86 PROPS-END
87 a
88
89
90 Node-path: trunk/b
91 Node-kind: file
92 Node-action: add
93 Prop-content-length: 10
94 Text-content-length: 2
95 Text-content-md5: 3b5d5c3712955042212316173ccf37be
96 Content-length: 12
97
98 PROPS-END
99 b
100
101
102 Revision-number: 3
103 Prop-content-length: 108
104 Content-length: 108
105
106 K 7
107 svn:log
108 V 7
109 removeb
110 K 10
111 svn:author
112 V 7
113 pmezard
114 K 8
115 svn:date
116 V 27
117 2008-12-06T13:44:23.176546Z
118 PROPS-END
119
120 Node-path: trunk/b
121 Node-action: delete
122
123
124 Revision-number: 4
125 Prop-content-length: 109
126 Content-length: 109
127
128 K 7
129 svn:log
130 V 8
131 changeaa
132 K 10
133 svn:author
134 V 7
135 pmezard
136 K 8
137 svn:date
138 V 27
139 2008-12-06T13:44:25.147151Z
140 PROPS-END
141
142 Node-path: trunk/a
143 Node-kind: file
144 Node-action: change
145 Text-content-length: 4
146 Text-content-md5: 0d227f1abf8c2932d342e9b99cc957eb
147 Content-length: 4
148
149 a
150 a
151
152
153 Revision-number: 5
154 Prop-content-length: 119
155 Content-length: 119
156
157 K 7
158 svn:log
159 V 17
160 branch, changeaaa
161 K 10
162 svn:author
163 V 7
164 pmezard
165 K 8
166 svn:date
167 V 27
168 2008-12-06T13:44:28.158475Z
169 PROPS-END
170
171 Node-path: branches/branch1
172 Node-kind: dir
173 Node-action: add
174 Node-copyfrom-rev: 4
175 Node-copyfrom-path: trunk
176 Prop-content-length: 34
177 Content-length: 34
178
179 K 13
180 svn:mergeinfo
181 V 0
182
183 PROPS-END
184
185
186 Node-path: branches/branch1/a
187 Node-kind: file
188 Node-action: change
189 Text-content-length: 6
190 Text-content-md5: 7d4ebf8f298d22fc349a91725b00af1c
191 Content-length: 6
192
193 a
194 a
195 a
196
197
198 Revision-number: 6
199 Prop-content-length: 117
200 Content-length: 117
201
202 K 7
203 svn:log
204 V 15
205 addc,changeaaaa
206 K 10
207 svn:author
208 V 7
209 pmezard
210 K 8
211 svn:date
212 V 27
213 2008-12-06T13:44:29.180655Z
214 PROPS-END
215
216 Node-path: branches/branch1/a
217 Node-kind: file
218 Node-action: change
219 Text-content-length: 8
220 Text-content-md5: d12178e74d8774e34361e0a08d1fd2b7
221 Content-length: 8
222
223 a
224 a
225 a
226 a
227
228
229 Node-path: branches/branch1/c
230 Node-kind: file
231 Node-action: add
232 Prop-content-length: 10
233 Text-content-length: 2
234 Text-content-md5: 2cd6ee2c70b0bde53fbe6cac3c8b8bb1
235 Content-length: 12
236
237 PROPS-END
238 c
239
240
@@ -0,0 +1,70 b''
1 #!/bin/sh
2 #
3 # Use this script to generate branches.svndump
4 #
5
6 mkdir temp
7 cd temp
8
9 mkdir project-orig
10 cd project-orig
11 mkdir trunk
12 mkdir branches
13 mkdir tags
14 cd ..
15
16 svnadmin create svn-repo
17 svnurl=file://`pwd`/svn-repo
18 svn import project-orig $svnurl -m "init projA"
19
20 svn co $svnurl project
21 cd project
22 echo a > trunk/a
23 echo b > trunk/b
24 echo c > trunk/c
25 # Add a file within branches, used to confuse branch detection
26 echo d > branches/notinbranch
27 svn add trunk/a trunk/b trunk/c branches/notinbranch
28 svn ci -m hello
29
30 # Branch to old
31 svn copy trunk branches/old
32 svn rm branches/old/c
33 svn ci -m "branch trunk, remove c"
34 svn up
35
36 # Update trunk
37 echo a >> trunk/a
38 svn ci -m "change a"
39
40 # Update old branch
41 echo b >> branches/old/b
42 svn ci -m "change b"
43
44 # Create a cross-branch revision
45 svn move trunk/b branches/old/c
46 echo c >> branches/old/c
47 svn ci -m "move and update c"
48
49 # Update old branch again
50 echo b >> branches/old/b
51 svn ci -m "change b again"
52
53 # Move back and forth between branch of similar names
54 # This used to generate fake copy records
55 svn up
56 svn move branches/old branches/old2
57 svn ci -m "move to old2"
58 svn move branches/old2 branches/old
59 svn ci -m "move back to old"
60
61 # Update trunk again
62 echo a > trunk/a
63 svn ci -m "last change to a"
64
65 # Branch again from a converted revision
66 svn copy -r 1 $svnurl/trunk branches/old3
67 svn ci -m "branch trunk@1 into old3"
68 cd ..
69
70 svnadmin dump svn-repo > ../branches.svndump
@@ -0,0 +1,62 b''
1 #!/bin/sh
2 #
3 # Use this script to generate move.svndump
4 #
5
6 mkdir temp
7 cd temp
8
9 mkdir project-orig
10 cd project-orig
11 mkdir trunk
12 echo a > trunk/a
13 mkdir trunk/d1
14 mkdir trunk/d2
15 echo b > trunk/d1/b
16 echo c > trunk/d1/c
17 echo d > trunk/d2/d
18 cd ..
19
20 svnadmin create svn-repo
21 svnurl=file://`pwd`/svn-repo
22 svn import project-orig $svnurl -m "init projA"
23
24 svn co $svnurl project
25 cd project
26 # Build a module renaming chain which used to confuse the converter.
27 # Update svn repository
28 echo a >> trunk/a
29 echo c >> trunk/d1/c
30 svn ci -m commitbeforemove
31 svn mv $svnurl/trunk $svnurl/subproject -m movedtrunk
32 svn up
33 mkdir subproject/trunk
34 svn add subproject/trunk
35 svn ci -m createtrunk
36 mkdir subproject/branches
37 svn add subproject/branches
38 svn ci -m createbranches
39 svn mv $svnurl/subproject/d1 $svnurl/subproject/trunk/d1 -m moved1
40 svn mv $svnurl/subproject/d2 $svnurl/subproject/trunk/d2 -m moved2
41 svn up
42 echo b >> subproject/trunk/d1/b
43
44 svn rm subproject/trunk/d2
45 svn ci -m "changeb and rm d2"
46 svn mv $svnurl/subproject/trunk/d1 $svnurl/subproject/branches/d1 -m moved1again
47
48 if svn help copy | grep 'SRC\[@REV\]' > /dev/null 2>&1; then
49 # SVN >= 1.5 replaced the -r REV syntax with @REV
50 # Copy a file from a past revision
51 svn copy $svnurl/subproject/trunk/d2/d@7 $svnurl/subproject/trunk -m copyfilefrompast
52 # Copy a directory from a past revision
53 svn copy $svnurl/subproject/trunk/d2@7 $svnurl/subproject/trunk -m copydirfrompast
54 else
55 # Copy a file from a past revision
56 svn copy -r 7 $svnurl/subproject/trunk/d2/d $svnurl/subproject/trunk -m copyfilefrompast
57 # Copy a directory from a past revision
58 svn copy -r 7 $svnurl/subproject/trunk/d2 $svnurl/subproject/trunk -m copydirfrompast
59 fi
60 cd ..
61
62 svnadmin dump svn-repo > ../move.svndump No newline at end of file
@@ -0,0 +1,45 b''
1 #!/bin/sh
2 #
3 # Use this script to generate startrev.svndump
4 #
5
6 mkdir temp
7 cd temp
8
9 mkdir project-orig
10 cd project-orig
11 mkdir trunk
12 mkdir branches
13 mkdir tags
14 cd ..
15
16 svnadmin create svn-repo
17 svnurl=file://`pwd`/svn-repo
18 svn import project-orig $svnurl -m "init projA"
19
20 svn co $svnurl project
21 cd project
22 echo a > trunk/a
23 echo b > trunk/b
24 svn add trunk/a trunk/b
25 svn ci -m createab
26 svn rm trunk/b
27 svn ci -m removeb
28 svn up
29 echo a >> trunk/a
30 svn ci -m changeaa
31
32 # Branch
33 svn up
34 svn copy trunk branches/branch1
35 echo a >> branches/branch1/a
36 svn ci -m "branch, changeaaa"
37
38 echo a >> branches/branch1/a
39 echo c > branches/branch1/c
40 svn add branches/branch1/c
41 svn ci -m "addc,changeaaaa"
42 svn up
43 cd ..
44
45 svnadmin dump svn-repo > ../startrev.svndump No newline at end of file
@@ -0,0 +1,49 b''
1 #!/bin/sh
2 #
3 # Use this script to generate tags.svndump
4 #
5
6 mkdir temp
7 cd temp
8
9 mkdir project-orig
10 cd project-orig
11 mkdir trunk
12 mkdir branches
13 mkdir tags
14 mkdir unrelated
15 cd ..
16
17 svnadmin create svn-repo
18 svnurl=file://`pwd`/svn-repo
19 svn import project-orig $svnurl -m "init projA"
20
21 svn co $svnurl project
22 cd project
23 echo a > trunk/a
24 svn add trunk/a
25 svn ci -m adda
26 echo a >> trunk/a
27 svn ci -m changea
28 echo a >> trunk/a
29 svn ci -m changea2
30 # Add an unrelated commit to test that tags are bound to the
31 # correct "from" revision and not a dummy one
32 echo a >> unrelated/dummy
33 svn add unrelated/dummy
34 svn ci -m unrelatedchange
35 # Tag current revision
36 svn up
37 svn copy trunk tags/trunk.v1
38 svn copy trunk tags/trunk.badtag
39 svn ci -m "tagging trunk.v1 trunk.badtag"
40 echo a >> trunk/a
41 svn ci -m changea3
42 # Fix the bad tag
43 # trunk.badtag should not show in converted tags
44 svn up
45 svn mv tags/trunk.badtag tags/trunk.goodtag
46 svn ci -m "fix trunk.badtag"
47 cd ..
48
49 svnadmin dump svn-repo > ../tags.svndump No newline at end of file
@@ -0,0 +1,295 b''
1 SVN-fs-dump-format-version: 2
2
3 UUID: 65371b91-a2cf-4cb1-a047-08b28c3b4c40
4
5 Revision-number: 0
6 Prop-content-length: 56
7 Content-length: 56
8
9 K 8
10 svn:date
11 V 27
12 2008-12-06T13:50:23.869747Z
13 PROPS-END
14
15 Revision-number: 1
16 Prop-content-length: 112
17 Content-length: 112
18
19 K 7
20 svn:log
21 V 10
22 init projA
23 K 10
24 svn:author
25 V 7
26 pmezard
27 K 8
28 svn:date
29 V 27
30 2008-12-06T13:50:23.944361Z
31 PROPS-END
32
33 Node-path: branches
34 Node-kind: dir
35 Node-action: add
36 Prop-content-length: 10
37 Content-length: 10
38
39 PROPS-END
40
41
42 Node-path: tags
43 Node-kind: dir
44 Node-action: add
45 Prop-content-length: 10
46 Content-length: 10
47
48 PROPS-END
49
50
51 Node-path: trunk
52 Node-kind: dir
53 Node-action: add
54 Prop-content-length: 10
55 Content-length: 10
56
57 PROPS-END
58
59
60 Node-path: unrelated
61 Node-kind: dir
62 Node-action: add
63 Prop-content-length: 10
64 Content-length: 10
65
66 PROPS-END
67
68
69 Revision-number: 2
70 Prop-content-length: 105
71 Content-length: 105
72
73 K 7
74 svn:log
75 V 4
76 adda
77 K 10
78 svn:author
79 V 7
80 pmezard
81 K 8
82 svn:date
83 V 27
84 2008-12-06T13:50:25.174397Z
85 PROPS-END
86
87 Node-path: trunk/a
88 Node-kind: file
89 Node-action: add
90 Prop-content-length: 10
91 Text-content-length: 2
92 Text-content-md5: 60b725f10c9c85c70d97880dfe8191b3
93 Content-length: 12
94
95 PROPS-END
96 a
97
98
99 Revision-number: 3
100 Prop-content-length: 108
101 Content-length: 108
102
103 K 7
104 svn:log
105 V 7
106 changea
107 K 10
108 svn:author
109 V 7
110 pmezard
111 K 8
112 svn:date
113 V 27
114 2008-12-06T13:50:26.148468Z
115 PROPS-END
116
117 Node-path: trunk/a
118 Node-kind: file
119 Node-action: change
120 Text-content-length: 4
121 Text-content-md5: 0d227f1abf8c2932d342e9b99cc957eb
122 Content-length: 4
123
124 a
125 a
126
127
128 Revision-number: 4
129 Prop-content-length: 109
130 Content-length: 109
131
132 K 7
133 svn:log
134 V 8
135 changea2
136 K 10
137 svn:author
138 V 7
139 pmezard
140 K 8
141 svn:date
142 V 27
143 2008-12-06T13:50:27.147988Z
144 PROPS-END
145
146 Node-path: trunk/a
147 Node-kind: file
148 Node-action: change
149 Text-content-length: 6
150 Text-content-md5: 7d4ebf8f298d22fc349a91725b00af1c
151 Content-length: 6
152
153 a
154 a
155 a
156
157
158 Revision-number: 5
159 Prop-content-length: 117
160 Content-length: 117
161
162 K 7
163 svn:log
164 V 15
165 unrelatedchange
166 K 10
167 svn:author
168 V 7
169 pmezard
170 K 8
171 svn:date
172 V 27
173 2008-12-06T13:50:28.174989Z
174 PROPS-END
175
176 Node-path: unrelated/dummy
177 Node-kind: file
178 Node-action: add
179 Prop-content-length: 10
180 Text-content-length: 2
181 Text-content-md5: 60b725f10c9c85c70d97880dfe8191b3
182 Content-length: 12
183
184 PROPS-END
185 a
186
187
188 Revision-number: 6
189 Prop-content-length: 131
190 Content-length: 131
191
192 K 7
193 svn:log
194 V 29
195 tagging trunk.v1 trunk.badtag
196 K 10
197 svn:author
198 V 7
199 pmezard
200 K 8
201 svn:date
202 V 27
203 2008-12-06T13:50:32.157783Z
204 PROPS-END
205
206 Node-path: tags/trunk.badtag
207 Node-kind: dir
208 Node-action: add
209 Node-copyfrom-rev: 5
210 Node-copyfrom-path: trunk
211 Prop-content-length: 34
212 Content-length: 34
213
214 K 13
215 svn:mergeinfo
216 V 0
217
218 PROPS-END
219
220
221 Node-path: tags/trunk.v1
222 Node-kind: dir
223 Node-action: add
224 Node-copyfrom-rev: 5
225 Node-copyfrom-path: trunk
226 Prop-content-length: 34
227 Content-length: 34
228
229 K 13
230 svn:mergeinfo
231 V 0
232
233 PROPS-END
234
235
236 Revision-number: 7
237 Prop-content-length: 109
238 Content-length: 109
239
240 K 7
241 svn:log
242 V 8
243 changea3
244 K 10
245 svn:author
246 V 7
247 pmezard
248 K 8
249 svn:date
250 V 27
251 2008-12-06T13:50:33.145803Z
252 PROPS-END
253
254 Node-path: trunk/a
255 Node-kind: file
256 Node-action: change
257 Text-content-length: 8
258 Text-content-md5: d12178e74d8774e34361e0a08d1fd2b7
259 Content-length: 8
260
261 a
262 a
263 a
264 a
265
266
267 Revision-number: 8
268 Prop-content-length: 118
269 Content-length: 118
270
271 K 7
272 svn:log
273 V 16
274 fix trunk.badtag
275 K 10
276 svn:author
277 V 7
278 pmezard
279 K 8
280 svn:date
281 V 27
282 2008-12-06T13:50:36.153842Z
283 PROPS-END
284
285 Node-path: tags/trunk.goodtag
286 Node-kind: dir
287 Node-action: add
288 Node-copyfrom-rev: 7
289 Node-copyfrom-path: tags/trunk.badtag
290
291
292 Node-path: tags/trunk.badtag
293 Node-action: delete
294
295
@@ -0,0 +1,30 b''
1 #!/bin/sh
2
3 echo "[extensions]" >> $HGRCPATH
4 echo "graphlog=" >> $HGRCPATH
5 echo "rebase=" >> $HGRCPATH
6
7 addcommit () {
8 echo $1 > $1
9 hg add $1
10 hg commit -d "${2} 0" -u test -m $1
11 }
12
13 hg init a
14 cd a
15 addcommit "c1" 0
16 addcommit "c2" 1
17
18 addcommit "l1" 2
19 addcommit "l2" 3
20
21 hg update -C 1
22 hg branch 'notdefault'
23 addcommit "r1" 4
24 hg glog --template '{rev}:{desc}:{branches}\n'
25
26 echo
27 echo '% Rebase a branch while preserving the branch name'
28 hg update -C 3
29 hg rebase -b 4 -d 3 --keepbranches 2>&1 | sed 's/\(saving bundle to \).*/\1/'
30 hg glog --template '{rev}:{desc}:{branches}\n'
@@ -0,0 +1,33 b''
1 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
2 marked working directory as branch notdefault
3 created new head
4 @ 4:r1:notdefault
5 |
6 | o 3:l2:
7 | |
8 | o 2:l1:
9 |/
10 o 1:c2:
11 |
12 o 0:c1:
13
14
15 % Rebase a branch while preserving the branch name
16 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
17 saving bundle to
18 adding branch
19 adding changesets
20 adding manifests
21 adding file changes
22 added 1 changesets with 1 changes to 1 files
23 rebase completed
24 @ 4:r1:notdefault
25 |
26 o 3:l2:
27 |
28 o 2:l1:
29 |
30 o 1:c2:
31 |
32 o 0:c1:
33
@@ -219,7 +219,7 b' email::'
219 convenient for recipients. Addresses, headers, and parts not
219 convenient for recipients. Addresses, headers, and parts not
220 containing patches of outgoing messages will be encoded in
220 containing patches of outgoing messages will be encoded in
221 the first charset to which conversion from local encoding
221 the first charset to which conversion from local encoding
222 (ui.encoding, ui.fallbackencoding) succeeds. If correct
222 ($HGENCODING, ui.fallbackencoding) succeeds. If correct
223 conversion fails, the text in question is sent as is.
223 conversion fails, the text in question is sent as is.
224 Defaults to empty (explicit) list.
224 Defaults to empty (explicit) list.
225
225
@@ -228,7 +228,7 b' email::'
228 us-ascii always first, regardless of settings
228 us-ascii always first, regardless of settings
229 email.charsets in order given by user
229 email.charsets in order given by user
230 ui.fallbackencoding if not in email.charsets
230 ui.fallbackencoding if not in email.charsets
231 ui.encoding if not in email.charsets
231 $HGENCODING if not in email.charsets
232 utf-8 always last, regardless of settings
232 utf-8 always last, regardless of settings
233
233
234 Email example:
234 Email example:
@@ -14,9 +14,19 b' bookmark is forwarded to the new changes'
14
14
15 It is possible to use bookmark names in every revision lookup (e.g. hg
15 It is possible to use bookmark names in every revision lookup (e.g. hg
16 merge, hg update).
16 merge, hg update).
17
18 The bookmark extension offers the possiblity to have a more git-like experience
19 by adding the following configuration option to your .hgrc:
20
21 [bookmarks]
22 track.current = True
23
24 This will cause bookmarks to track the bookmark that you are currently on, and
25 just updates it. This is similar to git's approach of branching.
17 '''
26 '''
18
27
19 from mercurial.commands import templateopts, hex, short
28 from mercurial.commands import templateopts, hex, short
29 from mercurial import extensions
20 from mercurial.i18n import _
30 from mercurial.i18n import _
21 from mercurial import cmdutil, util, commands, changelog
31 from mercurial import cmdutil, util, commands, changelog
22 from mercurial.node import nullid, nullrev
32 from mercurial.node import nullid, nullrev
@@ -55,10 +65,53 b' def write(repo, refs):'
55 if os.path.exists(repo.join('bookmarks')):
65 if os.path.exists(repo.join('bookmarks')):
56 util.copyfile(repo.join('bookmarks'), repo.join('undo.bookmarks'))
66 util.copyfile(repo.join('bookmarks'), repo.join('undo.bookmarks'))
57 file = repo.opener('bookmarks', 'w+')
67 file = repo.opener('bookmarks', 'w+')
68 if current(repo) not in refs:
69 setcurrent(repo, None)
58 for refspec, node in refs.items():
70 for refspec, node in refs.items():
59 file.write("%s %s\n" % (hex(node), refspec))
71 file.write("%s %s\n" % (hex(node), refspec))
60 file.close()
72 file.close()
61
73
74 def current(repo):
75 '''Get the current bookmark
76
77 If we use gittishsh branches we have a current bookmark that
78 we are on. This function returns the name of the bookmark. It
79 is stored in .hg/bookmarks.current
80 '''
81 if repo._bookmarkcurrent:
82 return repo._bookmarkcurrent
83 mark = None
84 if os.path.exists(repo.join('bookmarks.current')):
85 file = repo.opener('bookmarks.current')
86 mark = file.readline()
87 if mark == '':
88 mark = None
89 file.close()
90 repo._bookmarkcurrent = mark
91 return mark
92
93 def setcurrent(repo, mark):
94 '''Set the name of the bookmark that we are currently on
95
96 Set the name of the bookmark that we are on (hg update <bookmark>).
97 The name is recoreded in .hg/bookmarks.current
98 '''
99 if current(repo) == mark:
100 return
101
102 refs = parse(repo)
103
104 # do not update if we do update to a rev equal to the current bookmark
105 if (mark not in refs and
106 current(repo) and refs[current(repo)] == repo.changectx('.').node()):
107 return
108 if mark not in refs:
109 mark = ''
110 file = repo.opener('bookmarks.current', 'w+')
111 file.write(mark)
112 file.close()
113 repo._bookmarkcurrent = mark
114
62 def bookmark(ui, repo, mark=None, rev=None, force=False, delete=False, rename=None):
115 def bookmark(ui, repo, mark=None, rev=None, force=False, delete=False, rename=None):
63 '''mercurial bookmarks
116 '''mercurial bookmarks
64
117
@@ -121,7 +174,11 b' def bookmark(ui, repo, mark=None, rev=No'
121 ui.status("no bookmarks set\n")
174 ui.status("no bookmarks set\n")
122 else:
175 else:
123 for bmark, n in marks.iteritems():
176 for bmark, n in marks.iteritems():
124 prefix = (n == cur) and '*' or ' '
177 if ui.configbool('bookmarks', 'track.current'):
178 prefix = (bmark == current(repo) and n == cur) and '*' or ' '
179 else:
180 prefix = (n == cur) and '*' or ' '
181
125 ui.write(" %s %-25s %d:%s\n" % (
182 ui.write(" %s %-25s %d:%s\n" % (
126 prefix, bmark, repo.changelog.rev(n), hexfn(n)))
183 prefix, bmark, repo.changelog.rev(n), hexfn(n)))
127 return
184 return
@@ -166,6 +223,7 b' def reposetup(ui, repo):'
166 # init a bookmark cache as otherwise we would get a infinite reading
223 # init a bookmark cache as otherwise we would get a infinite reading
167 # in lookup()
224 # in lookup()
168 repo._bookmarks = None
225 repo._bookmarks = None
226 repo._bookmarkcurrent = None
169
227
170 class bookmark_repo(repo.__class__):
228 class bookmark_repo(repo.__class__):
171 def rollback(self):
229 def rollback(self):
@@ -192,9 +250,14 b' def reposetup(ui, repo):'
192 marks = parse(repo)
250 marks = parse(repo)
193 update = False
251 update = False
194 for mark, n in marks.items():
252 for mark, n in marks.items():
195 if n in parents:
253 if ui.configbool('bookmarks', 'track.current'):
196 marks[mark] = node
254 if mark == current(repo) and n in parents:
197 update = True
255 marks[mark] = node
256 update = True
257 else:
258 if n in parents:
259 marks[mark] = node
260 update = True
198 if update:
261 if update:
199 write(repo, marks)
262 write(repo, marks)
200 return node
263 return node
@@ -218,8 +281,35 b' def reposetup(ui, repo):'
218 write(repo, marks)
281 write(repo, marks)
219 return result
282 return result
220
283
284 def tags(self):
285 """Merge bookmarks with normal tags"""
286 if self.tagscache:
287 return self.tagscache
288
289 tagscache = super(bookmark_repo, self).tags()
290 tagscache.update(parse(repo))
291 return tagscache
292
221 repo.__class__ = bookmark_repo
293 repo.__class__ = bookmark_repo
222
294
295 def updatecurbookmark(orig, ui, repo, *args, **opts):
296 '''Set the current bookmark
297
298 If the user updates to a bookmark we update the .hg/bookmarks.current
299 file.
300 '''
301 res = orig(ui, repo, *args, **opts)
302 rev = opts['rev']
303 if not rev and len(args) > 0:
304 rev = args[0]
305 setcurrent(repo, rev)
306 return res
307
308 def uisetup(ui):
309 'Replace push with a decorator to provide --non-bookmarked option'
310 if ui.configbool('bookmarks', 'track.current'):
311 extensions.wrapcommand(commands.table, 'update', updatecurbookmark)
312
223 cmdtable = {
313 cmdtable = {
224 "bookmarks":
314 "bookmarks":
225 (bookmark,
315 (bookmark,
@@ -4,53 +4,107 b''
4 #
4 #
5 # This software may be used and distributed according to the terms
5 # This software may be used and distributed according to the terms
6 # of the GNU General Public License, incorporated herein by reference.
6 # of the GNU General Public License, incorporated herein by reference.
7 #
7
8 # hook extension to update comments of bugzilla bugs when changesets
8 '''Bugzilla integration
9 # that refer to bugs by id are seen. this hook does not change bug
9
10 # status, only comments.
10 This hook extension adds comments on bugs in Bugzilla when changesets
11 #
11 that refer to bugs by Bugzilla ID are seen. The hook does not change bug
12 # to configure, add items to '[bugzilla]' section of hgrc.
12 status.
13 #
13
14 # to use, configure bugzilla extension and enable like this:
14 The hook updates the Bugzilla database directly. Only Bugzilla installations
15 #
15 using MySQL are supported.
16 # [extensions]
16
17 # hgext.bugzilla =
17 The hook relies on a Bugzilla script to send bug change notification emails.
18 #
18 That script changes between Bugzilla versions; the 'processmail' script used
19 # [hooks]
19 prior to 2.18 is replaced in 2.18 and subsequent versions by
20 # # run bugzilla hook on every change pulled or pushed in here
20 'config/sendbugmail.pl'. Note that these will be run by Mercurial as the user
21 # incoming.bugzilla = python:hgext.bugzilla.hook
21 pushing the change; you will need to ensure the Bugzilla install file
22 #
22 permissions are set appropriately.
23 # config items:
23
24 #
24 Configuring the extension:
25 # section name is 'bugzilla'.
25
26 # [bugzilla]
26 [bugzilla]
27 #
27 host Hostname of the MySQL server holding the Bugzilla database.
28 # REQUIRED:
28 db Name of the Bugzilla database in MySQL. Default 'bugs'.
29 # host = bugzilla # mysql server where bugzilla database lives
29 user Username to use to access MySQL server. Default 'bugs'.
30 # password = ** # user's password
30 password Password to use to access MySQL server.
31 # version = 2.16 # version of bugzilla installed
31 timeout Database connection timeout (seconds). Default 5.
32 #
32 version Bugzilla version. Specify '3.0' for Bugzilla versions from
33 # OPTIONAL:
33 3.0 onwards, and '2.16' for versions prior to 3.0.
34 # bzuser = ... # fallback bugzilla user name to record comments with
34 bzuser Fallback Bugzilla user name to record comments with, if
35 # db = bugs # database to connect to
35 changeset committer cannot be found as a Bugzilla user.
36 # notify = ... # command to run to get bugzilla to send mail
36 notify The command to run to get Bugzilla to send bug change
37 # regexp = ... # regexp to match bug ids (must contain one "()" group)
37 notification emails. Substitutes one string parameter,
38 # strip = 0 # number of slashes to strip for url paths
38 the bug ID. Default 'cd /var/www/html/bugzilla && '
39 # style = ... # style file to use when formatting comments
39 './processmail %s nobody@nowhere.com'.
40 # template = ... # template to use when formatting comments
40 regexp Regular expression to match bug IDs in changeset commit message.
41 # timeout = 5 # database connection timeout (seconds)
41 Must contain one "()" group. The default expression matches
42 # user = bugs # user to connect to database as
42 'Bug 1234', 'Bug no. 1234', 'Bug number 1234',
43 # [web]
43 'Bugs 1234,5678', 'Bug 1234 and 5678' and variations thereof.
44 # baseurl = http://hgserver/... # root of hg web site for browsing commits
44 Matching is case insensitive.
45 #
45 style The style file to use when formatting comments.
46 # if hg committer names are not same as bugzilla user names, use
46 template Template to use when formatting comments. Overrides
47 # "usermap" feature to map from committer email to bugzilla user name.
47 style if specified. In addition to the usual Mercurial
48 # usermap can be in hgrc or separate config file.
48 keywords, the extension specifies:
49 #
49 {bug} The Bugzilla bug ID.
50 # [bugzilla]
50 {root} The full pathname of the Mercurial repository.
51 # usermap = filename # cfg file with "committer"="bugzilla user" info
51 {webroot} Stripped pathname of the Mercurial repository.
52 # [usermap]
52 {hgweb} Base URL for browsing Mercurial repositories.
53 # committer_email = bugzilla_user_name
53 Default 'changeset {node|short} in repo {root} refers '
54 'to bug {bug}.\\ndetails:\\n\\t{desc|tabindent}'
55 strip The number of slashes to strip from the front of {root}
56 to produce {webroot}. Default 0.
57 usermap Path of file containing Mercurial committer ID to Bugzilla user
58 ID mappings. If specified, the file should contain one mapping
59 per line, "committer"="Bugzilla user". See also the
60 [usermap] section.
61
62 [usermap]
63 Any entries in this section specify mappings of Mercurial committer ID
64 to Bugzilla user ID. See also [bugzilla].usermap.
65 "committer"="Bugzilla user"
66
67 [web]
68 baseurl Base URL for browsing Mercurial repositories. Reference from
69 templates as {hgweb}.
70
71 Activating the extension:
72
73 [extensions]
74 hgext.bugzilla =
75
76 [hooks]
77 # run bugzilla hook on every change pulled or pushed in here
78 incoming.bugzilla = python:hgext.bugzilla.hook
79
80 Example configuration:
81
82 This example configuration is for a collection of Mercurial repositories
83 in /var/local/hg/repos/ used with a local Bugzilla 3.2 installation in
84 /opt/bugzilla-3.2.
85
86 [bugzilla]
87 host=localhost
88 password=XYZZY
89 version=3.0
90 bzuser=unknown@domain.com
91 notify=cd /opt/bugzilla-3.2 && perl -T contrib/sendbugmail.pl %%s bugmail@domain.com
92 template=Changeset {node|short} in {root|basename}.\\n{hgweb}/{webroot}/rev/{node|short}\\n\\n{desc}\\n
93 strip=5
94
95 [web]
96 baseurl=http://dev.domain.com/hg
97
98 [usermap]
99 user@emaildomain.com=user.name@bugzilladomain.com
100
101 Commits add a comment to the Bugzilla bug record of the form:
102
103 Changeset 3b16791d6642 in repository-name.
104 http://dev.domain.com/hg/repository-name/rev/3b16791d6642
105
106 Changeset commit comment. Bug 1234.
107 '''
54
108
55 from mercurial.i18n import _
109 from mercurial.i18n import _
56 from mercurial.node import short
110 from mercurial.node import short
@@ -185,6 +239,7 b' class bugzilla_2_16(object):'
185 self.run('''insert into bugs_activity (bug_id, who, bug_when, fieldid)
239 self.run('''insert into bugs_activity (bug_id, who, bug_when, fieldid)
186 values (%s, %s, %s, %s)''',
240 values (%s, %s, %s, %s)''',
187 (bugid, userid, now, self.longdesc_id))
241 (bugid, userid, now, self.longdesc_id))
242 self.conn.commit()
188
243
189 class bugzilla_3_0(bugzilla_2_16):
244 class bugzilla_3_0(bugzilla_2_16):
190 '''support for bugzilla 3.0 series.'''
245 '''support for bugzilla 3.0 series.'''
@@ -7,6 +7,7 b''
7 '''converting foreign VCS repositories to Mercurial'''
7 '''converting foreign VCS repositories to Mercurial'''
8
8
9 import convcmd
9 import convcmd
10 import cvsps
10 from mercurial import commands
11 from mercurial import commands
11 from mercurial.i18n import _
12 from mercurial.i18n import _
12
13
@@ -183,7 +184,18 b' def convert(ui, src, dest=None, revmapfi'
183 def debugsvnlog(ui, **opts):
184 def debugsvnlog(ui, **opts):
184 return convcmd.debugsvnlog(ui, **opts)
185 return convcmd.debugsvnlog(ui, **opts)
185
186
186 commands.norepo += " convert debugsvnlog"
187 def debugcvsps(ui, *args, **opts):
188 '''Create changeset information from CVS
189
190 This command is intended as a debugging tool for the CVS to Mercurial
191 converter, and can be used as a direct replacement for cvsps.
192
193 Hg debugcvsps reads the CVS rlog for current directory (or any named
194 directory) in the CVS repository, and converts the log to a series of
195 changesets based on matching commit log entries and dates.'''
196 return cvsps.debugcvsps(ui, *args, **opts)
197
198 commands.norepo += " convert debugsvnlog debugcvsps"
187
199
188 cmdtable = {
200 cmdtable = {
189 "convert":
201 "convert":
@@ -200,4 +212,22 b' cmdtable = {'
200 (debugsvnlog,
212 (debugsvnlog,
201 [],
213 [],
202 'hg debugsvnlog'),
214 'hg debugsvnlog'),
215 "debugcvsps":
216 (debugcvsps,
217 [
218 # Main options shared with cvsps-2.1
219 ('b', 'branches', [], _('Only return changes on specified branches')),
220 ('p', 'prefix', '', _('Prefix to remove from file names')),
221 ('r', 'revisions', [], _('Only return changes after or between specified tags')),
222 ('u', 'update-cache', None, _("Update cvs log cache")),
223 ('x', 'new-cache', None, _("Create new cvs log cache")),
224 ('z', 'fuzz', 60, _('Set commit time fuzz in seconds')),
225 ('', 'root', '', _('Specify cvsroot')),
226 # Options specific to builtin cvsps
227 ('', 'parents', '', _('Show parent changesets')),
228 ('', 'ancestors', '', _('Show current changeset in ancestor branches')),
229 # Options that are ignored for compatibility with cvsps-2.1
230 ('A', 'cvs-direct', None, 'Ignored for compatibility'),
231 ],
232 'hg debugcvsps [OPTION]... [PATH]...'),
203 }
233 }
@@ -144,11 +144,11 b' class convert_cvs(converter_source):'
144 if branch == "HEAD":
144 if branch == "HEAD":
145 branch = ""
145 branch = ""
146 if branch:
146 if branch:
147 latest = None
147 latest = 0
148 # the last changeset that contains a base
148 # the last changeset that contains a base
149 # file is our parent
149 # file is our parent
150 for r in oldrevs:
150 for r in oldrevs:
151 latest = max(filerevids.get(r, None), latest)
151 latest = max(filerevids.get(r, 0), latest)
152 if latest:
152 if latest:
153 p = [latest]
153 p = [latest]
154
154
@@ -584,3 +584,95 b' def createchangeset(ui, log, fuzz=60, me'
584 ui.status(_('%d changeset entries\n') % len(changesets))
584 ui.status(_('%d changeset entries\n') % len(changesets))
585
585
586 return changesets
586 return changesets
587
588
589 def debugcvsps(ui, *args, **opts):
590 '''Read CVS rlog for current directory or named path in repository, and
591 convert the log to changesets based on matching commit log entries and dates.'''
592
593 if opts["new_cache"]:
594 cache = "write"
595 elif opts["update_cache"]:
596 cache = "update"
597 else:
598 cache = None
599
600 revisions = opts["revisions"]
601
602 try:
603 if args:
604 log = []
605 for d in args:
606 log += createlog(ui, d, root=opts["root"], cache=cache)
607 else:
608 log = createlog(ui, root=opts["root"], cache=cache)
609 except logerror, e:
610 ui.write("%r\n"%e)
611 return
612
613 changesets = createchangeset(ui, log, opts["fuzz"])
614 del log
615
616 # Print changesets (optionally filtered)
617
618 off = len(revisions)
619 branches = {} # latest version number in each branch
620 ancestors = {} # parent branch
621 for cs in changesets:
622
623 if opts["ancestors"]:
624 if cs.branch not in branches and cs.parents and cs.parents[0].id:
625 ancestors[cs.branch] = changesets[cs.parents[0].id-1].branch, cs.parents[0].id
626 branches[cs.branch] = cs.id
627
628 # limit by branches
629 if opts["branches"] and (cs.branch or 'HEAD') not in opts["branches"]:
630 continue
631
632 if not off:
633 # Note: trailing spaces on several lines here are needed to have
634 # bug-for-bug compatibility with cvsps.
635 ui.write('---------------------\n')
636 ui.write('PatchSet %d \n' % cs.id)
637 ui.write('Date: %s\n' % util.datestr(cs.date, '%Y/%m/%d %H:%M:%S %1%2'))
638 ui.write('Author: %s\n' % cs.author)
639 ui.write('Branch: %s\n' % (cs.branch or 'HEAD'))
640 ui.write('Tag%s: %s \n' % (['', 's'][len(cs.tags)>1],
641 ','.join(cs.tags) or '(none)'))
642 if opts["parents"] and cs.parents:
643 if len(cs.parents)>1:
644 ui.write('Parents: %s\n' % (','.join([str(p.id) for p in cs.parents])))
645 else:
646 ui.write('Parent: %d\n' % cs.parents[0].id)
647
648 if opts["ancestors"]:
649 b = cs.branch
650 r = []
651 while b:
652 b, c = ancestors[b]
653 r.append('%s:%d:%d' % (b or "HEAD", c, branches[b]))
654 if r:
655 ui.write('Ancestors: %s\n' % (','.join(r)))
656
657 ui.write('Log:\n')
658 ui.write('%s\n\n' % cs.comment)
659 ui.write('Members: \n')
660 for f in cs.entries:
661 fn = f.file
662 if fn.startswith(opts["prefix"]):
663 fn = fn[len(opts["prefix"]):]
664 ui.write('\t%s:%s->%s%s \n' % (fn, '.'.join([str(x) for x in f.parent]) or 'INITIAL',
665 '.'.join([str(x) for x in f.revision]), ['', '(DEAD)'][f.dead]))
666 ui.write('\n')
667
668 # have we seen the start tag?
669 if revisions and off:
670 if revisions[0] == str(cs.id) or \
671 revisions[0] in cs.tags:
672 off = False
673
674 # see if we reached the end tag
675 if len(revisions)>1 and not off:
676 if revisions[1] == str(cs.id) or \
677 revisions[1] in cs.tags:
678 break
@@ -724,12 +724,6 b' class svn_source(converter_source):'
724
724
725 self.child_cset = None
725 self.child_cset = None
726
726
727 def isdescendantof(parent, child):
728 if not child or not parent or not child.startswith(parent):
729 return False
730 subpath = child[len(parent):]
731 return len(subpath) > 1 and subpath[0] == '/'
732
733 def parselogentry(orig_paths, revnum, author, date, message):
727 def parselogentry(orig_paths, revnum, author, date, message):
734 """Return the parsed commit object or None, and True if
728 """Return the parsed commit object or None, and True if
735 the revision is a branch root.
729 the revision is a branch root.
@@ -752,21 +746,10 b' class svn_source(converter_source):'
752 if root_paths:
746 if root_paths:
753 path, ent = root_paths[-1]
747 path, ent = root_paths[-1]
754 if ent.copyfrom_path:
748 if ent.copyfrom_path:
755 # If dir was moved while one of its file was removed
756 # the log may look like:
757 # A /dir (from /dir:x)
758 # A /dir/a (from /dir/a:y)
759 # A /dir/b (from /dir/b:z)
760 # ...
761 # for all remaining children.
762 # Let's take the highest child element from rev as source.
763 copies = [(p,e) for p,e in orig_paths[:-1]
764 if isdescendantof(ent.copyfrom_path, e.copyfrom_path)]
765 fromrev = max([e.copyfrom_rev for p,e in copies] + [ent.copyfrom_rev])
766 branched = True
749 branched = True
767 newpath = ent.copyfrom_path + self.module[len(path):]
750 newpath = ent.copyfrom_path + self.module[len(path):]
768 # ent.copyfrom_rev may not be the actual last revision
751 # ent.copyfrom_rev may not be the actual last revision
769 previd = self.latest(newpath, fromrev)
752 previd = self.latest(newpath, ent.copyfrom_rev)
770 if previd is not None:
753 if previd is not None:
771 prevmodule, prevnum = self.revsplit(previd)[1:]
754 prevmodule, prevnum = self.revsplit(previd)[1:]
772 if prevnum >= self.startrev:
755 if prevnum >= self.startrev:
@@ -105,6 +105,7 b' class notifier(object):'
105 self.stripcount = int(self.ui.config('notify', 'strip', 0))
105 self.stripcount = int(self.ui.config('notify', 'strip', 0))
106 self.root = self.strip(self.repo.root)
106 self.root = self.strip(self.repo.root)
107 self.domain = self.ui.config('notify', 'domain')
107 self.domain = self.ui.config('notify', 'domain')
108 self.test = self.ui.configbool('notify', 'test', True)
108 self.charsets = mail._charsets(self.ui)
109 self.charsets = mail._charsets(self.ui)
109 self.subs = self.subscribers()
110 self.subs = self.subscribers()
110
111
@@ -157,7 +158,8 b' class notifier(object):'
157 for user in users.split(','):
158 for user in users.split(','):
158 subs[self.fixmail(user)] = 1
159 subs[self.fixmail(user)] = 1
159 subs = util.sort(subs)
160 subs = util.sort(subs)
160 return [mail.addressencode(self.ui, s, self.charsets) for s in subs]
161 return [mail.addressencode(self.ui, s, self.charsets, self.test)
162 for s in subs]
161
163
162 def url(self, path=None):
164 def url(self, path=None):
163 return self.ui.config('web', 'baseurl') + (path or self.root)
165 return self.ui.config('web', 'baseurl') + (path or self.root)
@@ -186,7 +188,7 b' class notifier(object):'
186 # create fresh mime message from msg body
188 # create fresh mime message from msg body
187 text = msg.get_payload()
189 text = msg.get_payload()
188 # for notification prefer readability over data precision
190 # for notification prefer readability over data precision
189 msg = mail.mimeencode(self.ui, text, self.charsets)
191 msg = mail.mimeencode(self.ui, text, self.charsets, self.test)
190
192
191 def fix_subject(subject):
193 def fix_subject(subject):
192 '''try to make subject line exist and be useful.'''
194 '''try to make subject line exist and be useful.'''
@@ -201,7 +203,8 b' class notifier(object):'
201 maxsubject = int(self.ui.config('notify', 'maxsubject', 67))
203 maxsubject = int(self.ui.config('notify', 'maxsubject', 67))
202 if maxsubject and len(subject) > maxsubject:
204 if maxsubject and len(subject) > maxsubject:
203 subject = subject[:maxsubject-3] + '...'
205 subject = subject[:maxsubject-3] + '...'
204 msg['Subject'] = mail.headencode(self.ui, subject, self.charsets)
206 msg['Subject'] = mail.headencode(self.ui, subject,
207 self.charsets, self.test)
205
208
206 def fix_sender(sender):
209 def fix_sender(sender):
207 '''try to make message have proper sender.'''
210 '''try to make message have proper sender.'''
@@ -210,7 +213,8 b' class notifier(object):'
210 sender = self.ui.config('email', 'from') or self.ui.username()
213 sender = self.ui.config('email', 'from') or self.ui.username()
211 if '@' not in sender or '@localhost' in sender:
214 if '@' not in sender or '@localhost' in sender:
212 sender = self.fixmail(sender)
215 sender = self.fixmail(sender)
213 msg['From'] = mail.addressencode(self.ui, sender, self.charsets)
216 msg['From'] = mail.addressencode(self.ui, sender,
217 self.charsets, self.test)
214
218
215 msg['Date'] = util.datestr(format="%a, %d %b %Y %H:%M:%S %1%2")
219 msg['Date'] = util.datestr(format="%a, %d %b %Y %H:%M:%S %1%2")
216 fix_subject(subject)
220 fix_subject(subject)
@@ -224,7 +228,7 b' class notifier(object):'
224 msg['To'] = ', '.join(self.subs)
228 msg['To'] = ', '.join(self.subs)
225
229
226 msgtext = msg.as_string(0)
230 msgtext = msg.as_string(0)
227 if self.ui.configbool('notify', 'test', True):
231 if self.test:
228 self.ui.write(msgtext)
232 self.ui.write(msgtext)
229 if not msgtext.endswith('\n'):
233 if not msgtext.endswith('\n'):
230 self.ui.write('\n')
234 self.ui.write('\n')
@@ -64,6 +64,14 b' def rebase(ui, repo, **opts):'
64 contf = opts.get('continue')
64 contf = opts.get('continue')
65 abortf = opts.get('abort')
65 abortf = opts.get('abort')
66 collapsef = opts.get('collapse', False)
66 collapsef = opts.get('collapse', False)
67 extrafn = opts.get('extrafn')
68 if opts.get('keepbranches', None):
69 if extrafn:
70 raise dispatch.ParseError('rebase',
71 _('cannot use both keepbranches and extrafn'))
72 def extrafn(ctx, extra):
73 extra['branch'] = ctx.branch()
74
67 if contf or abortf:
75 if contf or abortf:
68 if contf and abortf:
76 if contf and abortf:
69 raise dispatch.ParseError('rebase',
77 raise dispatch.ParseError('rebase',
@@ -101,14 +109,14 b' def rebase(ui, repo, **opts):'
101 storestatus(repo, originalwd, target, state, collapsef,
109 storestatus(repo, originalwd, target, state, collapsef,
102 external)
110 external)
103 rebasenode(repo, rev, target, state, skipped, targetancestors,
111 rebasenode(repo, rev, target, state, skipped, targetancestors,
104 collapsef)
112 collapsef, extrafn)
105 ui.note(_('rebase merging completed\n'))
113 ui.note(_('rebase merging completed\n'))
106
114
107 if collapsef:
115 if collapsef:
108 p1, p2 = defineparents(repo, min(state), target,
116 p1, p2 = defineparents(repo, min(state), target,
109 state, targetancestors)
117 state, targetancestors)
110 concludenode(repo, rev, p1, external, state, collapsef,
118 concludenode(repo, rev, p1, external, state, collapsef,
111 last=True, skipped=skipped)
119 last=True, skipped=skipped, extrafn=extrafn)
112
120
113 if 'qtip' in repo.tags():
121 if 'qtip' in repo.tags():
114 updatemq(repo, state, skipped, **opts)
122 updatemq(repo, state, skipped, **opts)
@@ -131,7 +139,8 b' def rebase(ui, repo, **opts):'
131 finally:
139 finally:
132 del lock, wlock
140 del lock, wlock
133
141
134 def concludenode(repo, rev, p1, p2, state, collapse, last=False, skipped={}):
142 def concludenode(repo, rev, p1, p2, state, collapse, last=False, skipped={},
143 extrafn=None):
135 """Skip commit if collapsing has been required and rev is not the last
144 """Skip commit if collapsing has been required and rev is not the last
136 revision, commit otherwise
145 revision, commit otherwise
137 """
146 """
@@ -155,18 +164,22 b' def concludenode(repo, rev, p1, p2, stat'
155 else:
164 else:
156 commitmsg = repo[rev].description()
165 commitmsg = repo[rev].description()
157 # Commit might fail if unresolved files exist
166 # Commit might fail if unresolved files exist
167 extra = {'rebase_source': repo[rev].hex()}
168 if extrafn:
169 extrafn(repo[rev], extra)
158 newrev = repo.commit(m+a+r,
170 newrev = repo.commit(m+a+r,
159 text=commitmsg,
171 text=commitmsg,
160 user=repo[rev].user(),
172 user=repo[rev].user(),
161 date=repo[rev].date(),
173 date=repo[rev].date(),
162 extra={'rebase_source': repo[rev].hex()})
174 extra=extra)
163 return newrev
175 return newrev
164 except util.Abort:
176 except util.Abort:
165 # Invalidate the previous setparents
177 # Invalidate the previous setparents
166 repo.dirstate.invalidate()
178 repo.dirstate.invalidate()
167 raise
179 raise
168
180
169 def rebasenode(repo, rev, target, state, skipped, targetancestors, collapse):
181 def rebasenode(repo, rev, target, state, skipped, targetancestors, collapse,
182 extrafn):
170 'Rebase a single revision'
183 'Rebase a single revision'
171 repo.ui.debug(_("rebasing %d:%s\n") % (rev, repo[rev]))
184 repo.ui.debug(_("rebasing %d:%s\n") % (rev, repo[rev]))
172
185
@@ -195,7 +208,8 b' def rebasenode(repo, rev, target, state,'
195 repo.ui.debug(_('resuming interrupted rebase\n'))
208 repo.ui.debug(_('resuming interrupted rebase\n'))
196
209
197
210
198 newrev = concludenode(repo, rev, p1, p2, state, collapse)
211 newrev = concludenode(repo, rev, p1, p2, state, collapse,
212 extrafn=extrafn)
199
213
200 # Update the state
214 # Update the state
201 if newrev is not None:
215 if newrev is not None:
@@ -409,6 +423,7 b' cmdtable = {'
409 (rebase,
423 (rebase,
410 [
424 [
411 ('', 'keep', False, _('keep original revisions')),
425 ('', 'keep', False, _('keep original revisions')),
426 ('', 'keepbranches', False, _('keep original branches')),
412 ('s', 'source', '', _('rebase from a given revision')),
427 ('s', 'source', '', _('rebase from a given revision')),
413 ('b', 'base', '', _('rebase from the base of a given revision')),
428 ('b', 'base', '', _('rebase from the base of a given revision')),
414 ('d', 'dest', '', _('rebase onto a given revision')),
429 ('d', 'dest', '', _('rebase onto a given revision')),
@@ -179,7 +179,7 b' class changelog(revlog):'
179
179
180 user = user.strip()
180 user = user.strip()
181 if "\n" in user:
181 if "\n" in user:
182 raise RevlogError(_("username %s contains a newline") % `user`)
182 raise RevlogError(_("username %s contains a newline") % repr(user))
183 user, desc = util.fromlocal(user), util.fromlocal(desc)
183 user, desc = util.fromlocal(user), util.fromlocal(desc)
184
184
185 if date:
185 if date:
@@ -90,7 +90,7 b' def _runcatch(ui, args):'
90 else:
90 else:
91 raise
91 raise
92 except socket.error, inst:
92 except socket.error, inst:
93 ui.warn(_("abort: %s\n") % inst[-1])
93 ui.warn(_("abort: %s\n") % inst.args[-1])
94 except IOError, inst:
94 except IOError, inst:
95 if hasattr(inst, "code"):
95 if hasattr(inst, "code"):
96 ui.warn(_("abort: %s\n") % inst)
96 ui.warn(_("abort: %s\n") % inst)
@@ -100,7 +100,7 b' def _runcatch(ui, args):'
100 except: # it might be anything, for example a string
100 except: # it might be anything, for example a string
101 reason = inst.reason
101 reason = inst.reason
102 ui.warn(_("abort: error: %s\n") % reason)
102 ui.warn(_("abort: error: %s\n") % reason)
103 elif hasattr(inst, "args") and inst[0] == errno.EPIPE:
103 elif hasattr(inst, "args") and inst.args[0] == errno.EPIPE:
104 if ui.debugflag:
104 if ui.debugflag:
105 ui.warn(_("broken pipe\n"))
105 ui.warn(_("broken pipe\n"))
106 elif getattr(inst, "strerror", None):
106 elif getattr(inst, "strerror", None):
@@ -116,13 +116,13 b' def _runcatch(ui, args):'
116 else:
116 else:
117 ui.warn(_("abort: %s\n") % inst.strerror)
117 ui.warn(_("abort: %s\n") % inst.strerror)
118 except util.UnexpectedOutput, inst:
118 except util.UnexpectedOutput, inst:
119 ui.warn(_("abort: %s") % inst[0])
119 ui.warn(_("abort: %s") % inst.args[0])
120 if not isinstance(inst[1], basestring):
120 if not isinstance(inst.args[1], basestring):
121 ui.warn(" %r\n" % (inst[1],))
121 ui.warn(" %r\n" % (inst.args[1],))
122 elif not inst[1]:
122 elif not inst.args[1]:
123 ui.warn(_(" empty string\n"))
123 ui.warn(_(" empty string\n"))
124 else:
124 else:
125 ui.warn("\n%r\n" % util.ellipsis(inst[1]))
125 ui.warn("\n%r\n" % util.ellipsis(inst.args[1]))
126 except ImportError, inst:
126 except ImportError, inst:
127 m = str(inst).split()[-1]
127 m = str(inst).split()[-1]
128 ui.warn(_("abort: could not import module %s!\n") % m)
128 ui.warn(_("abort: could not import module %s!\n") % m)
@@ -22,17 +22,20 b' class NoHunks(PatchError):'
22
22
23 # helper functions
23 # helper functions
24
24
25 def copyfile(src, dst, basedir=None):
25 def copyfile(src, dst, basedir):
26 if not basedir:
26 abssrc, absdst = [util.canonpath(basedir, basedir, x) for x in [src, dst]]
27 basedir = os.getcwd()
28
29 abssrc, absdst = [os.path.join(basedir, n) for n in (src, dst)]
30 if os.path.exists(absdst):
27 if os.path.exists(absdst):
31 raise util.Abort(_("cannot create %s: destination already exists") %
28 raise util.Abort(_("cannot create %s: destination already exists") %
32 dst)
29 dst)
33
30
34 if not os.path.isdir(basedir):
31 dstdir = os.path.dirname(absdst)
35 os.makedirs(basedir)
32 if dstdir and not os.path.isdir(dstdir):
33 try:
34 os.makedirs(dstdir)
35 except IOError:
36 raise util.Abort(
37 _("cannot create %s: unable to create destination directory")
38 % dst)
36
39
37 util.copyfile(abssrc, absdst)
40 util.copyfile(abssrc, absdst)
38
41
@@ -977,9 +980,7 b' def applydiff(ui, fp, changed, strip=1, '
977 cwd = os.getcwd()
980 cwd = os.getcwd()
978 for gp in gitpatches:
981 for gp in gitpatches:
979 if gp.op in ('COPY', 'RENAME'):
982 if gp.op in ('COPY', 'RENAME'):
980 src, dst = [util.canonpath(cwd, cwd, x)
983 copyfile(gp.oldpath, gp.path, cwd)
981 for x in [gp.oldpath, gp.path]]
982 copyfile(src, dst)
983 changed[gp.path] = gp
984 changed[gp.path] = gp
984 else:
985 else:
985 raise util.Abort(_('unsupported parser state: %s') % state)
986 raise util.Abort(_('unsupported parser state: %s') % state)
@@ -350,7 +350,7 b' class ui(object):'
350 if not user:
350 if not user:
351 raise util.Abort(_("Please specify a username."))
351 raise util.Abort(_("Please specify a username."))
352 if "\n" in user:
352 if "\n" in user:
353 raise util.Abort(_("username %s contains a newline\n") % `user`)
353 raise util.Abort(_("username %s contains a newline\n") % repr(user))
354 return user
354 return user
355
355
356 def shortuser(self, user):
356 def shortuser(self, user):
@@ -407,7 +407,8 b' class ui(object):'
407 import readline
407 import readline
408 # force demandimport to really load the module
408 # force demandimport to really load the module
409 readline.read_history_file
409 readline.read_history_file
410 except ImportError:
410 # windows sometimes raises something other than ImportError
411 except Exception:
411 pass
412 pass
412 line = raw_input(prompt)
413 line = raw_input(prompt)
413 # When stdin is in binary mode on Windows, it can cause
414 # When stdin is in binary mode on Windows, it can cause
@@ -705,7 +705,7 b' def system(cmd, environ={}, cwd=None, on'
705 if cwd is not None and oldcwd != cwd:
705 if cwd is not None and oldcwd != cwd:
706 os.chdir(oldcwd)
706 os.chdir(oldcwd)
707
707
708 class SignatureError:
708 class SignatureError(Exception):
709 pass
709 pass
710
710
711 def checksignature(func):
711 def checksignature(func):
@@ -1901,7 +1901,7 b' def walkrepos(path, followsym=False, see'
1901 _add_dir_if_not_there(seen_dirs, path)
1901 _add_dir_if_not_there(seen_dirs, path)
1902 for root, dirs, files in os.walk(path, topdown=True, onerror=errhandler):
1902 for root, dirs, files in os.walk(path, topdown=True, onerror=errhandler):
1903 if '.hg' in dirs:
1903 if '.hg' in dirs:
1904 dirs.remove('.hg') # don't recurse inside the .hg directory
1904 dirs[:] = [] # don't descend further
1905 yield root # found a repository
1905 yield root # found a repository
1906 qroot = os.path.join(root, '.hg', 'patches')
1906 qroot = os.path.join(root, '.hg', 'patches')
1907 if os.path.isdir(os.path.join(qroot, '.hg')):
1907 if os.path.isdir(os.path.join(qroot, '.hg')):
@@ -19,7 +19,7 b' import osutil'
19 import util
19 import util
20 from win32com.shell import shell,shellcon
20 from win32com.shell import shell,shellcon
21
21
22 class WinError:
22 class WinError(Exception):
23 winerror_map = {
23 winerror_map = {
24 winerror.ERROR_ACCESS_DENIED: errno.EACCES,
24 winerror.ERROR_ACCESS_DENIED: errno.EACCES,
25 winerror.ERROR_ACCOUNT_DISABLED: errno.EACCES,
25 winerror.ERROR_ACCOUNT_DISABLED: errno.EACCES,
@@ -9,13 +9,13 b' def test1(a, b):'
9 if d:
9 if d:
10 c = mpatch.patches(a, [d])
10 c = mpatch.patches(a, [d])
11 if c != b:
11 if c != b:
12 print "***", `a`, `b`
12 print "***", repr(a), repr(b)
13 print "bad:"
13 print "bad:"
14 print `c`[:200]
14 print repr(c)[:200]
15 print `d`
15 print repr(d)
16
16
17 def test(a, b):
17 def test(a, b):
18 print "***", `a`, `b`
18 print "***", repr(a), repr(b)
19 test1(a, b)
19 test1(a, b)
20 test1(b, a)
20 test1(b, a)
21
21
@@ -18,6 +18,8 b' added 1 changesets with 1 changes to 1 f'
18 rebase completed
18 rebase completed
19 changeset: 3:9163974d1cb5
19 changeset: 3:9163974d1cb5
20 tag: tip
20 tag: tip
21 tag: two
22 tag: one
21 parent: 1:925d80f479bb
23 parent: 1:925d80f479bb
22 parent: 2:db815d6d32e6
24 parent: 2:db815d6d32e6
23 user: test
25 user: test
@@ -7,6 +7,7 b' no bookmarks set'
7 * X 0:f7b1eb17ad24
7 * X 0:f7b1eb17ad24
8 % look up bookmark
8 % look up bookmark
9 changeset: 0:f7b1eb17ad24
9 changeset: 0:f7b1eb17ad24
10 tag: X
10 tag: tip
11 tag: tip
11 user: test
12 user: test
12 date: Thu Jan 01 00:00:00 1970 +0000
13 date: Thu Jan 01 00:00:00 1970 +0000
@@ -51,7 +52,10 b' abort: a bookmark of this name does not '
51 * x y 2:0316ce92851d
52 * x y 2:0316ce92851d
52 % look up stripped bookmark name
53 % look up stripped bookmark name
53 changeset: 2:0316ce92851d
54 changeset: 2:0316ce92851d
55 tag: X2
56 tag: Y
54 tag: tip
57 tag: tip
58 tag: x y
55 user: test
59 user: test
56 date: Thu Jan 01 00:00:00 1970 +0000
60 date: Thu Jan 01 00:00:00 1970 +0000
57 summary: 2
61 summary: 2
@@ -102,3 +102,7 b" hg -R src-filemap log --template '#rev# "
102
102
103 echo "graphlog = " >> $HGRCPATH
103 echo "graphlog = " >> $HGRCPATH
104 hg -R src-hg glog --template '#rev# (#branches#) #desc# files: #files#\n'
104 hg -R src-hg glog --template '#rev# (#branches#) #desc# files: #files#\n'
105
106 echo % testing debugcvsps
107 cd src
108 hg debugcvsps | sed -e 's/Author:.*/Author:/' -e 's/Date:.*/Date:/'
@@ -136,3 +136,71 b' o 5 (branch) ci2 files: b/c'
136 |/
136 |/
137 o 0 () Initial revision files: a b/c
137 o 0 () Initial revision files: a b/c
138
138
139 % testing debugcvsps
140 collecting CVS rlog
141 8 log entries
142 creating changesets
143 5 changeset entries
144 ---------------------
145 PatchSet 1
146 Date:
147 Author:
148 Branch: HEAD
149 Tag: (none)
150 Log:
151 Initial revision
152
153 Members:
154 a:INITIAL->1.1
155 b/c:INITIAL->1.1
156
157 ---------------------
158 PatchSet 2
159 Date:
160 Author:
161 Branch: INITIAL
162 Tag: start
163 Log:
164 import
165
166 Members:
167 a:1.1->1.1.1.1
168 b/c:1.1->1.1.1.1
169
170 ---------------------
171 PatchSet 3
172 Date:
173 Author:
174 Branch: HEAD
175 Tag: (none)
176 Log:
177 ci0
178
179 Members:
180 b/c:1.1->1.2
181
182 ---------------------
183 PatchSet 4
184 Date:
185 Author:
186 Branch: HEAD
187 Tag: (none)
188 Log:
189 ci1
190
191 Members:
192 a:1.1->1.2
193 b/c:1.2->1.3
194
195 ---------------------
196 PatchSet 5
197 Date:
198 Author:
199 Branch: branch
200 Tag: (none)
201 Log:
202 ci2
203
204 Members:
205 b/c:1.1->1.1.2.1
206
@@ -12,6 +12,7 b' echo "convert = " >> $HGRCPATH'
12 echo "hgext.graphlog =" >> $HGRCPATH
12 echo "hgext.graphlog =" >> $HGRCPATH
13
13
14 svnadmin create svn-repo
14 svnadmin create svn-repo
15 cat "$TESTDIR/svn/branches.svndump" | svnadmin load svn-repo > /dev/null
15
16
16 svnpath=`pwd | fix_path`
17 svnpath=`pwd | fix_path`
17 # SVN wants all paths to start with a slash. Unfortunately,
18 # SVN wants all paths to start with a slash. Unfortunately,
@@ -20,73 +21,10 b' expr $svnpath : "\\/" > /dev/null'
20 if [ $? -ne 0 ]; then
21 if [ $? -ne 0 ]; then
21 svnpath='/'$svnpath
22 svnpath='/'$svnpath
22 fi
23 fi
23
24 svnurl=file://$svnpath/svn-repo
24 echo % initial svn import
25 mkdir projA
26 cd projA
27 mkdir trunk
28 mkdir branches
29 mkdir tags
30 cd ..
31
32 svnurl=file://$svnpath/svn-repo/projA
33 svn import -m "init projA" projA $svnurl | fix_path
34
35 echo % update svn repository
36 svn co $svnurl A | fix_path
37 cd A
38 echo a > trunk/a
39 echo b > trunk/b
40 echo c > trunk/c
41 # Add a file within branches, used to confuse branch detection
42 echo d > branches/notinbranch
43 svn add trunk/a trunk/b trunk/c branches/notinbranch
44 svn ci -m hello
45
46 echo % branch to old
47 svn copy trunk branches/old
48 svn rm branches/old/c
49 svn ci -m "branch trunk, remove c"
50 svn up
51
52 echo % update trunk
53 "$TESTDIR/svn-safe-append.py" a trunk/a
54 svn ci -m "change a"
55
56 echo % update old branch
57 "$TESTDIR/svn-safe-append.py" b branches/old/b
58 svn ci -m "change b"
59
60 echo % create a cross-branch revision
61 svn move trunk/b branches/old/c
62 "$TESTDIR/svn-safe-append.py" c branches/old/c
63 svn ci -m "move and update c"
64
65 echo % update old branch again
66 "$TESTDIR/svn-safe-append.py" b branches/old/b
67 svn ci -m "change b again"
68
69 echo % move back and forth between branch of similar names
70 # This used to generate fake copy records
71 svn up
72 svn move branches/old branches/old2
73 svn ci -m "move to old2"
74 svn move branches/old2 branches/old
75 svn ci -m "move back to old"
76
77 echo % update trunk again
78 "$TESTDIR/svn-safe-append.py" a trunk/a
79 svn ci -m "last change to a"
80 cd ..
81
25
82 echo % convert trunk and branches
26 echo % convert trunk and branches
83 hg convert --datesort $svnurl A-hg
27 hg convert --datesort -r 10 $svnurl A-hg
84
85 echo % branch again from a converted revision
86 cd A
87 svn copy -r 1 $svnurl/trunk branches/old3
88 svn ci -m "branch trunk@1 into old3"
89 cd ..
90
28
91 echo % convert again
29 echo % convert again
92 hg convert --datesort $svnurl A-hg
30 hg convert --datesort $svnurl A-hg
@@ -1,77 +1,3 b''
1 % initial svn import
2 Adding projA/trunk
3 Adding projA/branches
4 Adding projA/tags
5
6 Committed revision 1.
7 % update svn repository
8 A A/trunk
9 A A/branches
10 A A/tags
11 Checked out revision 1.
12 A trunk/a
13 A trunk/b
14 A trunk/c
15 A branches/notinbranch
16 Adding branches/notinbranch
17 Adding trunk/a
18 Adding trunk/b
19 Adding trunk/c
20 Transmitting file data ....
21 Committed revision 2.
22 % branch to old
23 A branches/old
24 D branches/old/c
25 Adding branches/old
26 Adding branches/old/a
27 Adding branches/old/b
28 Deleting branches/old/c
29
30 Committed revision 3.
31 At revision 3.
32 % update trunk
33 Sending trunk/a
34 Transmitting file data .
35 Committed revision 4.
36 % update old branch
37 Sending branches/old/b
38 Transmitting file data .
39 Committed revision 5.
40 % create a cross-branch revision
41 A branches/old/c
42 D trunk/b
43 Adding branches/old/c
44 Deleting trunk/b
45 Transmitting file data .
46 Committed revision 6.
47 % update old branch again
48 Sending branches/old/b
49 Transmitting file data .
50 Committed revision 7.
51 % move back and forth between branch of similar names
52 At revision 7.
53 A branches/old2
54 D branches/old/a
55 D branches/old/b
56 D branches/old/c
57 D branches/old
58 Deleting branches/old
59 Adding branches/old2
60
61 Committed revision 8.
62 A branches/old
63 D branches/old2/a
64 D branches/old2/b
65 D branches/old2/c
66 D branches/old2
67 Adding branches/old
68 Deleting branches/old2
69
70 Committed revision 9.
71 % update trunk again
72 Sending trunk/a
73 Transmitting file data .
74 Committed revision 10.
75 % convert trunk and branches
1 % convert trunk and branches
76 initializing destination A-hg repository
2 initializing destination A-hg repository
77 scanning source...
3 scanning source...
@@ -88,12 +14,6 b' 3 change b again'
88 2 move to old2
14 2 move to old2
89 1 move back to old
15 1 move back to old
90 0 last change to a
16 0 last change to a
91 % branch again from a converted revision
92 Checked out revision 1.
93 A branches/old3
94 Adding branches/old3
95
96 Committed revision 11.
97 % convert again
17 % convert again
98 scanning source...
18 scanning source...
99 sorting...
19 sorting...
@@ -117,8 +37,8 b' o branch=old3 11 branch trunk@1 into ol'
117 | | |
37 | | |
118 | o | branch= 3 change a files: a
38 | o | branch= 3 change a files: a
119 | | |
39 | | |
120 | | o branch=old 2 branch trunk, remove c files:
40 +---o branch=old 2 branch trunk, remove c files: a b
121 | |/
41 | |
122 | o branch= 1 hello files: a b c
42 | o branch= 1 hello files: a b c
123 |/
43 |/
124 o branch= 0 init projA files:
44 o branch= 0 init projA files:
@@ -12,6 +12,7 b' echo "convert = " >> $HGRCPATH'
12 echo "hgext.graphlog =" >> $HGRCPATH
12 echo "hgext.graphlog =" >> $HGRCPATH
13
13
14 svnadmin create svn-repo
14 svnadmin create svn-repo
15 cat "$TESTDIR/svn/move.svndump" | svnadmin load svn-repo > /dev/null
15
16
16 svnpath=`pwd | fix_path`
17 svnpath=`pwd | fix_path`
17 # SVN wants all paths to start with a slash. Unfortunately,
18 # SVN wants all paths to start with a slash. Unfortunately,
@@ -20,58 +21,7 b' expr $svnpath : "\\/" > /dev/null'
20 if [ $? -ne 0 ]; then
21 if [ $? -ne 0 ]; then
21 svnpath='/'$svnpath
22 svnpath='/'$svnpath
22 fi
23 fi
23
24 svnurl=file://$svnpath/svn-repo
24 echo % initial svn import
25 mkdir projA
26 cd projA
27 mkdir trunk
28 echo a > trunk/a
29 mkdir trunk/d1
30 mkdir trunk/d2
31 echo b > trunk/d1/b
32 echo c > trunk/d1/c
33 echo d > trunk/d2/d
34 cd ..
35
36 svnurl=file://$svnpath/svn-repo/projA
37 svn import -m "init projA" projA $svnurl | fix_path
38
39 # Build a module renaming chain which used to confuse the converter.
40 echo % update svn repository
41 svn co $svnurl A | fix_path
42 cd A
43 "$TESTDIR/svn-safe-append.py" a trunk/a
44 "$TESTDIR/svn-safe-append.py" c trunk/d1/c
45 svn ci -m commitbeforemove
46 svn mv $svnurl/trunk $svnurl/subproject -m movedtrunk
47 svn up
48 mkdir subproject/trunk
49 svn add subproject/trunk
50 svn ci -m createtrunk
51 mkdir subproject/branches
52 svn add subproject/branches
53 svn ci -m createbranches
54 svn mv $svnurl/subproject/d1 $svnurl/subproject/trunk/d1 -m moved1
55 svn mv $svnurl/subproject/d2 $svnurl/subproject/trunk/d2 -m moved2
56 svn up
57 "$TESTDIR/svn-safe-append.py" b subproject/trunk/d1/b
58 svn rm subproject/trunk/d2
59 svn ci -m "changeb and rm d2"
60 svn mv $svnurl/subproject/trunk/d1 $svnurl/subproject/branches/d1 -m moved1again
61
62 if svn help copy | grep 'SRC\[@REV\]' > /dev/null 2>&1; then
63 # SVN >= 1.5 replaced the -r REV syntax with @REV
64 echo % copy a file from a past revision
65 svn copy $svnurl/subproject/trunk/d2/d@7 $svnurl/subproject/trunk -m copyfilefrompast
66 echo % copy a directory from a past revision
67 svn copy $svnurl/subproject/trunk/d2@7 $svnurl/subproject/trunk -m copydirfrompast
68 else
69 echo % copy a file from a past revision
70 svn copy -r 7 $svnurl/subproject/trunk/d2/d $svnurl/subproject/trunk -m copyfilefrompast
71 echo % copy a directory from a past revision
72 svn copy -r 7 $svnurl/subproject/trunk/d2 $svnurl/subproject/trunk -m copydirfrompast
73 fi
74 cd ..
75
25
76 echo % convert trunk and branches
26 echo % convert trunk and branches
77 hg convert --datesort $svnurl/subproject A-hg
27 hg convert --datesort $svnurl/subproject A-hg
@@ -1,71 +1,3 b''
1 % initial svn import
2 Adding projA/trunk
3 Adding projA/trunk/a
4 Adding projA/trunk/d1
5 Adding projA/trunk/d1/b
6 Adding projA/trunk/d1/c
7 Adding projA/trunk/d2
8 Adding projA/trunk/d2/d
9
10 Committed revision 1.
11 % update svn repository
12 A A/trunk
13 A A/trunk/a
14 A A/trunk/d1
15 A A/trunk/d1/b
16 A A/trunk/d1/c
17 A A/trunk/d2
18 A A/trunk/d2/d
19 Checked out revision 1.
20 Sending trunk/a
21 Sending trunk/d1/c
22 Transmitting file data ..
23 Committed revision 2.
24
25 Committed revision 3.
26 D trunk
27 A subproject
28 A subproject/a
29 A subproject/d1
30 A subproject/d1/b
31 A subproject/d1/c
32 A subproject/d2
33 A subproject/d2/d
34 Updated to revision 3.
35 A subproject/trunk
36 Adding subproject/trunk
37
38 Committed revision 4.
39 A subproject/branches
40 Adding subproject/branches
41
42 Committed revision 5.
43
44 Committed revision 6.
45
46 Committed revision 7.
47 A subproject/trunk/d1
48 A subproject/trunk/d1/b
49 A subproject/trunk/d1/c
50 A subproject/trunk/d2
51 A subproject/trunk/d2/d
52 D subproject/d1
53 D subproject/d2
54 Updated to revision 7.
55 D subproject/trunk/d2/d
56 D subproject/trunk/d2
57 Sending subproject/trunk/d1/b
58 Deleting subproject/trunk/d2
59 Transmitting file data .
60 Committed revision 8.
61
62 Committed revision 9.
63 % copy a file from a past revision
64
65 Committed revision 10.
66 % copy a directory from a past revision
67
68 Committed revision 11.
69 % convert trunk and branches
1 % convert trunk and branches
70 initializing destination A-hg repository
2 initializing destination A-hg repository
71 scanning source...
3 scanning source...
@@ -12,6 +12,7 b' echo "convert = " >> $HGRCPATH'
12 echo "hgext.graphlog =" >> $HGRCPATH
12 echo "hgext.graphlog =" >> $HGRCPATH
13
13
14 svnadmin create svn-repo
14 svnadmin create svn-repo
15 cat "$TESTDIR/svn/startrev.svndump" | svnadmin load svn-repo > /dev/null
15
16
16 svnpath=`pwd | fix_path`
17 svnpath=`pwd | fix_path`
17 # SVN wants all paths to start with a slash. Unfortunately,
18 # SVN wants all paths to start with a slash. Unfortunately,
@@ -20,43 +21,7 b' expr $svnpath : "\\/" > /dev/null'
20 if [ $? -ne 0 ]; then
21 if [ $? -ne 0 ]; then
21 svnpath='/'$svnpath
22 svnpath='/'$svnpath
22 fi
23 fi
23
24 svnurl=file://$svnpath/svn-repo
24 echo % initial svn import
25 mkdir projA
26 cd projA
27 mkdir trunk
28 mkdir branches
29 mkdir tags
30 cd ..
31
32 svnurl=file://$svnpath/svn-repo/projA
33 svn import -m "init projA" projA $svnurl | fix_path
34
35 echo % update svn repository
36 svn co $svnurl A | fix_path
37 cd A
38 echo a > trunk/a
39 echo b > trunk/b
40 svn add trunk/a trunk/b
41 svn ci -m createab
42 svn rm trunk/b
43 svn ci -m removeb
44 svn up
45 "$TESTDIR/svn-safe-append.py" a trunk/a
46 svn ci -m changeaa
47
48 echo % branch
49 svn up
50 svn copy trunk branches/branch1
51 "$TESTDIR/svn-safe-append.py" a branches/branch1/a
52 svn ci -m "branch, changeaaa"
53
54 "$TESTDIR/svn-safe-append.py" a branches/branch1/a
55 echo c > branches/branch1/c
56 svn add branches/branch1/c
57 svn ci -m "addc,changeaaaa"
58 svn up
59 cd ..
60
25
61 convert()
26 convert()
62 {
27 {
@@ -1,41 +1,3 b''
1 % initial svn import
2 Adding projA/trunk
3 Adding projA/branches
4 Adding projA/tags
5
6 Committed revision 1.
7 % update svn repository
8 A A/trunk
9 A A/branches
10 A A/tags
11 Checked out revision 1.
12 A trunk/a
13 A trunk/b
14 Adding trunk/a
15 Adding trunk/b
16 Transmitting file data ..
17 Committed revision 2.
18 D trunk/b
19 Deleting trunk/b
20
21 Committed revision 3.
22 At revision 3.
23 Sending trunk/a
24 Transmitting file data .
25 Committed revision 4.
26 % branch
27 At revision 4.
28 A branches/branch1
29 Adding branches/branch1
30 Sending branches/branch1/a
31 Transmitting file data .
32 Committed revision 5.
33 A branches/branch1/c
34 Sending branches/branch1/a
35 Adding branches/branch1/c
36 Transmitting file data ..
37 Committed revision 6.
38 At revision 6.
39 % convert before branching point
1 % convert before branching point
40 initializing destination A-r3-hg repository
2 initializing destination A-r3-hg repository
41 scanning source...
3 scanning source...
@@ -12,6 +12,7 b' echo "convert = " >> $HGRCPATH'
12 echo "hgext.graphlog =" >> $HGRCPATH
12 echo "hgext.graphlog =" >> $HGRCPATH
13
13
14 svnadmin create svn-repo
14 svnadmin create svn-repo
15 cat "$TESTDIR/svn/tags.svndump" | svnadmin load svn-repo > /dev/null
15
16
16 svnpath=`pwd | fix_path`
17 svnpath=`pwd | fix_path`
17 # SVN wants all paths to start with a slash. Unfortunately,
18 # SVN wants all paths to start with a slash. Unfortunately,
@@ -20,47 +21,7 b' expr $svnpath : "\\/" > /dev/null'
20 if [ $? -ne 0 ]; then
21 if [ $? -ne 0 ]; then
21 svnpath='/'$svnpath
22 svnpath='/'$svnpath
22 fi
23 fi
23
24 svnurl=file://$svnpath/svn-repo
24 echo % initial svn import
25 mkdir projA
26 cd projA
27 mkdir trunk
28 mkdir branches
29 mkdir tags
30 mkdir unrelated
31 cd ..
32
33 svnurl=file://$svnpath/svn-repo/projA
34 svn import -m "init projA" projA $svnurl | fix_path | sort
35
36 echo % update svn repository
37 svn co $svnurl A | fix_path
38 cd A
39 echo a > trunk/a
40 svn add trunk/a
41 svn ci -m adda
42 "$TESTDIR/svn-safe-append.py" a trunk/a
43 svn ci -m changea
44 "$TESTDIR/svn-safe-append.py" a trunk/a
45 svn ci -m changea2
46 # Add an unrelated commit to test that tags are bound to the
47 # correct "from" revision and not a dummy one
48 "$TESTDIR/svn-safe-append.py" a unrelated/dummy
49 svn add unrelated/dummy
50 svn ci -m unrelatedchange
51 echo % tag current revision
52 svn up
53 svn copy trunk tags/trunk.v1
54 svn copy trunk tags/trunk.badtag
55 svn ci -m "tagging trunk.v1 trunk.badtag"
56 "$TESTDIR/svn-safe-append.py" a trunk/a
57 svn ci -m changea3
58 echo % fix the bad tag
59 # trunk.badtag should not show in converted tags
60 svn up
61 svn mv tags/trunk.badtag tags/trunk.goodtag
62 svn ci -m "fix trunk.badtag"
63 cd ..
64
25
65 echo % convert
26 echo % convert
66 hg convert --datesort $svnurl A-hg
27 hg convert --datesort $svnurl A-hg
@@ -1,50 +1,3 b''
1 % initial svn import
2
3 Adding projA/branches
4 Adding projA/tags
5 Adding projA/trunk
6 Adding projA/unrelated
7 Committed revision 1.
8 % update svn repository
9 A A/trunk
10 A A/unrelated
11 A A/branches
12 A A/tags
13 Checked out revision 1.
14 A trunk/a
15 Adding trunk/a
16 Transmitting file data .
17 Committed revision 2.
18 Sending trunk/a
19 Transmitting file data .
20 Committed revision 3.
21 Sending trunk/a
22 Transmitting file data .
23 Committed revision 4.
24 A unrelated/dummy
25 Adding unrelated/dummy
26 Transmitting file data .
27 Committed revision 5.
28 % tag current revision
29 At revision 5.
30 A tags/trunk.v1
31 A tags/trunk.badtag
32 Adding tags/trunk.badtag
33 Adding tags/trunk.v1
34
35 Committed revision 6.
36 Sending trunk/a
37 Transmitting file data .
38 Committed revision 7.
39 % fix the bad tag
40 At revision 7.
41 A tags/trunk.goodtag
42 D tags/trunk.badtag/a
43 D tags/trunk.badtag
44 Deleting tags/trunk.badtag
45 Adding tags/trunk.goodtag
46
47 Committed revision 8.
48 % convert
1 % convert
49 initializing destination A-hg repository
2 initializing destination A-hg repository
50 scanning source...
3 scanning source...
@@ -16,14 +16,8 b" hg --cwd b ci -Amb -d'2 0'"
16 hg init c
16 hg init c
17 echo c > c/c
17 echo c > c/c
18 hg --cwd c ci -Amc -d'3 0'
18 hg --cwd c ci -Amc -d'3 0'
19 root=`pwd`
19
20
20 cd b
21 hg init d
22 echo d > d/d
23 hg --cwd d ci -Amd
24 cd ..
25
26 root=`pwd`
27 cd ..
21 cd ..
28
22
29 cat > paths.conf <<EOF
23 cat > paths.conf <<EOF
@@ -85,7 +79,6 b' echo % should succeed'
85 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/file/tip/a?style=raw'
79 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/file/tip/a?style=raw'
86 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/b/file/tip/b?style=raw'
80 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/b/file/tip/b?style=raw'
87 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/c/file/tip/c?style=raw'
81 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/c/file/tip/c?style=raw'
88 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/b/d/rev/tip/?style=raw'
89
82
90 echo % paths errors 1
83 echo % paths errors 1
91 cat error-paths-1.log
84 cat error-paths-1.log
@@ -1,7 +1,6 b''
1 adding a
1 adding a
2 adding b
2 adding b
3 adding c
3 adding c
4 adding d
5 % should give a 404 - file does not exist
4 % should give a 404 - file does not exist
6 404 Not Found
5 404 Not Found
7
6
@@ -32,7 +31,6 b' 200 Script output follows'
32 /b/
31 /b/
33 /coll/a/
32 /coll/a/
34 /coll/b/
33 /coll/b/
35 /coll/b/d/
36 /coll/c/
34 /coll/c/
37 /t/a/
35 /t/a/
38
36
@@ -112,7 +110,6 b' 200 Script output follows'
112
110
113 /coll/a/
111 /coll/a/
114 /coll/b/
112 /coll/b/
115 /coll/b/d/
116 /coll/c/
113 /coll/c/
117
114
118 200 Script output follows
115 200 Script output follows
@@ -124,7 +121,6 b' 200 Script output follows'
124
121
125 /a/
122 /a/
126 /b/
123 /b/
127 /b/d/
128 /c/
124 /c/
129
125
130 200 Script output follows
126 200 Script output follows
@@ -136,21 +132,6 b' b'
136 200 Script output follows
132 200 Script output follows
137
133
138 c
134 c
139 200 Script output follows
140
141
142 # HG changeset patch
143 # User test
144 # Date 0 0
145 # Node ID 43cb50608b2ae8635a62e2e8730adefc32a274ee
146
147 d
148
149 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
150 +++ b/d Thu Jan 01 00:00:00 1970 +0000
151 @@ -0,0 +1,1 @@
152 +d
153
154 % paths errors 1
135 % paths errors 1
155 % paths errors 2
136 % paths errors 2
156 % collections errors
137 % collections errors
@@ -71,3 +71,15 b' echo % display rejections'
71 cat b.rej
71 cat b.rej
72 cd ..
72 cd ..
73
73
74 echo % test push creating directory during git copy or rename
75 hg init missingdir
76 cd missingdir
77 echo a > a
78 hg ci -Am adda
79 mkdir d
80 hg copy a d/a2
81 hg mv a d/a
82 hg qnew -g -f patch
83 hg qpop
84 hg qpush
85 cd ..
@@ -47,3 +47,8 b' GIT binary patch'
47 literal 2
47 literal 2
48 Jc${No0000400IC2
48 Jc${No0000400IC2
49
49
50 % test push creating directory during git copy or rename
51 adding a
52 Patch queue now empty
53 applying patch
54 Now at: patch
@@ -15,15 +15,16 b' move changeset (and descendants) to a di'
15
15
16 options:
16 options:
17
17
18 --keep keep original revisions
18 --keep keep original revisions
19 -s --source rebase from a given revision
19 --keepbranches keep original branches
20 -b --base rebase from the base of a given revision
20 -s --source rebase from a given revision
21 -d --dest rebase onto a given revision
21 -b --base rebase from the base of a given revision
22 --collapse collapse the rebased revisions
22 -d --dest rebase onto a given revision
23 -c --continue continue an interrupted rebase
23 --collapse collapse the rebased revisions
24 -a --abort abort an interrupted rebase
24 -c --continue continue an interrupted rebase
25 --style display using template map file
25 -a --abort abort an interrupted rebase
26 --template display with template
26 --style display using template map file
27 --template display with template
27
28
28 use "hg -v help rebase" to show global options
29 use "hg -v help rebase" to show global options
29
30
@@ -42,15 +43,16 b' move changeset (and descendants) to a di'
42
43
43 options:
44 options:
44
45
45 --keep keep original revisions
46 --keep keep original revisions
46 -s --source rebase from a given revision
47 --keepbranches keep original branches
47 -b --base rebase from the base of a given revision
48 -s --source rebase from a given revision
48 -d --dest rebase onto a given revision
49 -b --base rebase from the base of a given revision
49 --collapse collapse the rebased revisions
50 -d --dest rebase onto a given revision
50 -c --continue continue an interrupted rebase
51 --collapse collapse the rebased revisions
51 -a --abort abort an interrupted rebase
52 -c --continue continue an interrupted rebase
52 --style display using template map file
53 -a --abort abort an interrupted rebase
53 --template display with template
54 --style display using template map file
55 --template display with template
54
56
55 use "hg -v help rebase" to show global options
57 use "hg -v help rebase" to show global options
56
58
@@ -69,15 +71,16 b' move changeset (and descendants) to a di'
69
71
70 options:
72 options:
71
73
72 --keep keep original revisions
74 --keep keep original revisions
73 -s --source rebase from a given revision
75 --keepbranches keep original branches
74 -b --base rebase from the base of a given revision
76 -s --source rebase from a given revision
75 -d --dest rebase onto a given revision
77 -b --base rebase from the base of a given revision
76 --collapse collapse the rebased revisions
78 -d --dest rebase onto a given revision
77 -c --continue continue an interrupted rebase
79 --collapse collapse the rebased revisions
78 -a --abort abort an interrupted rebase
80 -c --continue continue an interrupted rebase
79 --style display using template map file
81 -a --abort abort an interrupted rebase
80 --template display with template
82 --style display using template map file
83 --template display with template
81
84
82 use "hg -v help rebase" to show global options
85 use "hg -v help rebase" to show global options
83
86
@@ -96,15 +99,16 b' move changeset (and descendants) to a di'
96
99
97 options:
100 options:
98
101
99 --keep keep original revisions
102 --keep keep original revisions
100 -s --source rebase from a given revision
103 --keepbranches keep original branches
101 -b --base rebase from the base of a given revision
104 -s --source rebase from a given revision
102 -d --dest rebase onto a given revision
105 -b --base rebase from the base of a given revision
103 --collapse collapse the rebased revisions
106 -d --dest rebase onto a given revision
104 -c --continue continue an interrupted rebase
107 --collapse collapse the rebased revisions
105 -a --abort abort an interrupted rebase
108 -c --continue continue an interrupted rebase
106 --style display using template map file
109 -a --abort abort an interrupted rebase
107 --template display with template
110 --style display using template map file
111 --template display with template
108
112
109 use "hg -v help rebase" to show global options
113 use "hg -v help rebase" to show global options
110
114
@@ -12,12 +12,6 b" hg.repository(u, 'top1', create=1)"
12 mkdir('subdir')
12 mkdir('subdir')
13 chdir('subdir')
13 chdir('subdir')
14 hg.repository(u, 'sub1', create=1)
14 hg.repository(u, 'sub1', create=1)
15 chdir('sub1')
16 hg.repository(u, 'inside_sub1', create=1)
17 chdir('.hg')
18 hg.repository(u, 'patches', create=1)
19 chdir(os.path.pardir)
20 chdir(os.path.pardir)
21 mkdir('subsubdir')
15 mkdir('subsubdir')
22 chdir('subsubdir')
16 chdir('subsubdir')
23 hg.repository(u, 'subsub1', create=1)
17 hg.repository(u, 'subsub1', create=1)
@@ -28,28 +22,28 b' if sym:'
28
22
29 def runtest():
23 def runtest():
30 reposet = frozenset(walkrepos('.', followsym=True))
24 reposet = frozenset(walkrepos('.', followsym=True))
31 if sym and (len(reposet) != 5):
25 if sym and (len(reposet) != 3):
32 print "reposet = %r" % (reposet,)
26 print "reposet = %r" % (reposet,)
33 raise SystemExit(1, "Found %d repositories when I should have found 5" % (len(reposet),))
27 print "Found %d repositories when I should have found 3" % (len(reposet),)
34 if (not sym) and (len(reposet) != 4):
28 if (not sym) and (len(reposet) != 2):
35 print "reposet = %r" % (reposet,)
29 print "reposet = %r" % (reposet,)
36 raise SystemExit(1, "Found %d repositories when I should have found 4" % (len(reposet),))
30 print "Found %d repositories when I should have found 2" % (len(reposet),)
37 sub1set = frozenset((pjoin('.', 'sub1'),
31 sub1set = frozenset((pjoin('.', 'sub1'),
38 pjoin('.', 'circle', 'subdir', 'sub1')))
32 pjoin('.', 'circle', 'subdir', 'sub1')))
39 if len(sub1set & reposet) != 1:
33 if len(sub1set & reposet) != 1:
40 print "sub1set = %r" % (sub1set,)
34 print "sub1set = %r" % (sub1set,)
41 print "reposet = %r" % (reposet,)
35 print "reposet = %r" % (reposet,)
42 raise SystemExit(1, "sub1set and reposet should have exactly one path in common.")
36 print "sub1set and reposet should have exactly one path in common."
43 sub2set = frozenset((pjoin('.', 'subsub1'),
37 sub2set = frozenset((pjoin('.', 'subsub1'),
44 pjoin('.', 'subsubdir', 'subsub1')))
38 pjoin('.', 'subsubdir', 'subsub1')))
45 if len(sub2set & reposet) != 1:
39 if len(sub2set & reposet) != 1:
46 print "sub2set = %r" % (sub2set,)
40 print "sub2set = %r" % (sub2set,)
47 print "reposet = %r" % (reposet,)
41 print "reposet = %r" % (reposet,)
48 raise SystemExit(1, "sub1set and reposet should have exactly one path in common.")
42 print "sub1set and reposet should have exactly one path in common."
49 sub3 = pjoin('.', 'circle', 'top1')
43 sub3 = pjoin('.', 'circle', 'top1')
50 if sym and not (sub3 in reposet):
44 if sym and not (sub3 in reposet):
51 print "reposet = %r" % (reposet,)
45 print "reposet = %r" % (reposet,)
52 raise SystemExit(1, "Symbolic links are supported and %s is not in reposet" % (sub3,))
46 print "Symbolic links are supported and %s is not in reposet" % (sub3,)
53
47
54 runtest()
48 runtest()
55 if sym:
49 if sym:
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now