Show More
@@ -184,6 +184,12 b' def _clonerevlogs(' | |||||
184 | cdstsize = 0 |
|
184 | cdstsize = 0 | |
185 |
|
185 | |||
186 | alldatafiles = list(srcrepo.store.walk()) |
|
186 | alldatafiles = list(srcrepo.store.walk()) | |
|
187 | # mapping of data files which needs to be cloned | |||
|
188 | # key is unencoded filename | |||
|
189 | # value is revlog_object_from_srcrepo | |||
|
190 | manifests = {} | |||
|
191 | changelogs = {} | |||
|
192 | filelogs = {} | |||
187 |
|
193 | |||
188 | # Perform a pass to collect metadata. This validates we can open all |
|
194 | # Perform a pass to collect metadata. This validates we can open all | |
189 | # source files and allows a unified progress bar to be displayed. |
|
195 | # source files and allows a unified progress bar to be displayed. | |
@@ -209,15 +215,18 b' def _clonerevlogs(' | |||||
209 |
|
215 | |||
210 | # This is for the separate progress bars. |
|
216 | # This is for the separate progress bars. | |
211 | if isinstance(rl, changelog.changelog): |
|
217 | if isinstance(rl, changelog.changelog): | |
|
218 | changelogs[unencoded] = rl | |||
212 | crevcount += len(rl) |
|
219 | crevcount += len(rl) | |
213 | csrcsize += datasize |
|
220 | csrcsize += datasize | |
214 | crawsize += rawsize |
|
221 | crawsize += rawsize | |
215 | elif isinstance(rl, manifest.manifestrevlog): |
|
222 | elif isinstance(rl, manifest.manifestrevlog): | |
|
223 | manifests[unencoded] = rl | |||
216 | mcount += 1 |
|
224 | mcount += 1 | |
217 | mrevcount += len(rl) |
|
225 | mrevcount += len(rl) | |
218 | msrcsize += datasize |
|
226 | msrcsize += datasize | |
219 | mrawsize += rawsize |
|
227 | mrawsize += rawsize | |
220 | elif isinstance(rl, filelog.filelog): |
|
228 | elif isinstance(rl, filelog.filelog): | |
|
229 | filelogs[unencoded] = rl | |||
221 | fcount += 1 |
|
230 | fcount += 1 | |
222 | frevcount += len(rl) |
|
231 | frevcount += len(rl) | |
223 | fsrcsize += datasize |
|
232 | fsrcsize += datasize | |
@@ -248,86 +257,21 b' def _clonerevlogs(' | |||||
248 |
|
257 | |||
249 | sidedatacompanion = getsidedatacompanion(srcrepo, dstrepo) |
|
258 | sidedatacompanion = getsidedatacompanion(srcrepo, dstrepo) | |
250 |
|
259 | |||
251 | # Do the actual copying. |
|
260 | # Migrating filelogs | |
252 | # FUTURE this operation can be farmed off to worker processes. |
|
261 | ui.status( | |
253 | seen = set() |
|
262 | _( | |
254 | for unencoded, encoded, size in alldatafiles: |
|
263 | b'migrating %d filelogs containing %d revisions ' | |
255 | if unencoded.endswith(b'.d'): |
|
264 | b'(%s in store; %s tracked data)\n' | |
256 | continue |
|
265 | ) | |
257 |
|
266 | % ( | ||
258 | oldrl = _revlogfrompath(srcrepo, unencoded) |
|
267 | fcount, | |
259 |
|
268 | frevcount, | ||
260 | if isinstance(oldrl, changelog.changelog) and b'c' not in seen: |
|
269 | util.bytecount(fsrcsize), | |
261 | ui.status( |
|
270 | util.bytecount(frawsize), | |
262 | _( |
|
271 | ) | |
263 | b'finished migrating %d manifest revisions across %d ' |
|
272 | ) | |
264 | b'manifests; change in size: %s\n' |
|
273 | progress = srcrepo.ui.makeprogress(_(b'file revisions'), total=frevcount) | |
265 | ) |
|
274 | for unencoded, oldrl in sorted(filelogs.items()): | |
266 | % (mrevcount, mcount, util.bytecount(mdstsize - msrcsize)) |
|
|||
267 | ) |
|
|||
268 |
|
||||
269 | ui.status( |
|
|||
270 | _( |
|
|||
271 | b'migrating changelog containing %d revisions ' |
|
|||
272 | b'(%s in store; %s tracked data)\n' |
|
|||
273 | ) |
|
|||
274 | % ( |
|
|||
275 | crevcount, |
|
|||
276 | util.bytecount(csrcsize), |
|
|||
277 | util.bytecount(crawsize), |
|
|||
278 | ) |
|
|||
279 | ) |
|
|||
280 | seen.add(b'c') |
|
|||
281 | progress = srcrepo.ui.makeprogress( |
|
|||
282 | _(b'changelog revisions'), total=crevcount |
|
|||
283 | ) |
|
|||
284 | elif isinstance(oldrl, manifest.manifestrevlog) and b'm' not in seen: |
|
|||
285 | ui.status( |
|
|||
286 | _( |
|
|||
287 | b'finished migrating %d filelog revisions across %d ' |
|
|||
288 | b'filelogs; change in size: %s\n' |
|
|||
289 | ) |
|
|||
290 | % (frevcount, fcount, util.bytecount(fdstsize - fsrcsize)) |
|
|||
291 | ) |
|
|||
292 |
|
||||
293 | ui.status( |
|
|||
294 | _( |
|
|||
295 | b'migrating %d manifests containing %d revisions ' |
|
|||
296 | b'(%s in store; %s tracked data)\n' |
|
|||
297 | ) |
|
|||
298 | % ( |
|
|||
299 | mcount, |
|
|||
300 | mrevcount, |
|
|||
301 | util.bytecount(msrcsize), |
|
|||
302 | util.bytecount(mrawsize), |
|
|||
303 | ) |
|
|||
304 | ) |
|
|||
305 | seen.add(b'm') |
|
|||
306 | if progress: |
|
|||
307 | progress.complete() |
|
|||
308 | progress = srcrepo.ui.makeprogress( |
|
|||
309 | _(b'manifest revisions'), total=mrevcount |
|
|||
310 | ) |
|
|||
311 | elif b'f' not in seen: |
|
|||
312 | ui.status( |
|
|||
313 | _( |
|
|||
314 | b'migrating %d filelogs containing %d revisions ' |
|
|||
315 | b'(%s in store; %s tracked data)\n' |
|
|||
316 | ) |
|
|||
317 | % ( |
|
|||
318 | fcount, |
|
|||
319 | frevcount, |
|
|||
320 | util.bytecount(fsrcsize), |
|
|||
321 | util.bytecount(frawsize), |
|
|||
322 | ) |
|
|||
323 | ) |
|
|||
324 | seen.add(b'f') |
|
|||
325 | if progress: |
|
|||
326 | progress.complete() |
|
|||
327 | progress = srcrepo.ui.makeprogress( |
|
|||
328 | _(b'file revisions'), total=frevcount |
|
|||
329 | ) |
|
|||
330 |
|
||||
331 | newrl = _perform_clone( |
|
275 | newrl = _perform_clone( | |
332 | ui, |
|
276 | ui, | |
333 | dstrepo, |
|
277 | dstrepo, | |
@@ -342,18 +286,94 b' def _clonerevlogs(' | |||||
342 | ) |
|
286 | ) | |
343 | info = newrl.storageinfo(storedsize=True) |
|
287 | info = newrl.storageinfo(storedsize=True) | |
344 | datasize = info[b'storedsize'] or 0 |
|
288 | datasize = info[b'storedsize'] or 0 | |
345 |
|
||||
346 | dstsize += datasize |
|
289 | dstsize += datasize | |
|
290 | fdstsize += datasize | |||
|
291 | ui.status( | |||
|
292 | _( | |||
|
293 | b'finished migrating %d filelog revisions across %d ' | |||
|
294 | b'filelogs; change in size: %s\n' | |||
|
295 | ) | |||
|
296 | % (frevcount, fcount, util.bytecount(fdstsize - fsrcsize)) | |||
|
297 | ) | |||
347 |
|
298 | |||
348 | if isinstance(newrl, changelog.changelog): |
|
299 | # Migrating manifests | |
349 | cdstsize += datasize |
|
300 | ui.status( | |
350 | elif isinstance(newrl, manifest.manifestrevlog): |
|
301 | _( | |
351 | mdstsize += datasize |
|
302 | b'migrating %d manifests containing %d revisions ' | |
352 | else: |
|
303 | b'(%s in store; %s tracked data)\n' | |
353 | fdstsize += datasize |
|
304 | ) | |
|
305 | % ( | |||
|
306 | mcount, | |||
|
307 | mrevcount, | |||
|
308 | util.bytecount(msrcsize), | |||
|
309 | util.bytecount(mrawsize), | |||
|
310 | ) | |||
|
311 | ) | |||
|
312 | if progress: | |||
|
313 | progress.complete() | |||
|
314 | progress = srcrepo.ui.makeprogress( | |||
|
315 | _(b'manifest revisions'), total=mrevcount | |||
|
316 | ) | |||
|
317 | for unencoded, oldrl in sorted(manifests.items()): | |||
|
318 | newrl = _perform_clone( | |||
|
319 | ui, | |||
|
320 | dstrepo, | |||
|
321 | tr, | |||
|
322 | oldrl, | |||
|
323 | unencoded, | |||
|
324 | deltareuse, | |||
|
325 | forcedeltabothparents, | |||
|
326 | revlogs, | |||
|
327 | sidedatacompanion, | |||
|
328 | oncopiedrevision, | |||
|
329 | ) | |||
|
330 | info = newrl.storageinfo(storedsize=True) | |||
|
331 | datasize = info[b'storedsize'] or 0 | |||
|
332 | dstsize += datasize | |||
|
333 | mdstsize += datasize | |||
|
334 | ui.status( | |||
|
335 | _( | |||
|
336 | b'finished migrating %d manifest revisions across %d ' | |||
|
337 | b'manifests; change in size: %s\n' | |||
|
338 | ) | |||
|
339 | % (mrevcount, mcount, util.bytecount(mdstsize - msrcsize)) | |||
|
340 | ) | |||
354 |
|
341 | |||
|
342 | # Migrating changelog | |||
|
343 | ui.status( | |||
|
344 | _( | |||
|
345 | b'migrating changelog containing %d revisions ' | |||
|
346 | b'(%s in store; %s tracked data)\n' | |||
|
347 | ) | |||
|
348 | % ( | |||
|
349 | crevcount, | |||
|
350 | util.bytecount(csrcsize), | |||
|
351 | util.bytecount(crawsize), | |||
|
352 | ) | |||
|
353 | ) | |||
|
354 | if progress: | |||
|
355 | progress.complete() | |||
|
356 | progress = srcrepo.ui.makeprogress( | |||
|
357 | _(b'changelog revisions'), total=crevcount | |||
|
358 | ) | |||
|
359 | for unencoded, oldrl in sorted(changelogs.items()): | |||
|
360 | newrl = _perform_clone( | |||
|
361 | ui, | |||
|
362 | dstrepo, | |||
|
363 | tr, | |||
|
364 | oldrl, | |||
|
365 | unencoded, | |||
|
366 | deltareuse, | |||
|
367 | forcedeltabothparents, | |||
|
368 | revlogs, | |||
|
369 | sidedatacompanion, | |||
|
370 | oncopiedrevision, | |||
|
371 | ) | |||
|
372 | info = newrl.storageinfo(storedsize=True) | |||
|
373 | datasize = info[b'storedsize'] or 0 | |||
|
374 | dstsize += datasize | |||
|
375 | cdstsize += datasize | |||
355 | progress.complete() |
|
376 | progress.complete() | |
356 |
|
||||
357 | ui.status( |
|
377 | ui.status( | |
358 | _( |
|
378 | _( | |
359 | b'finished migrating %d changelog revisions; change in size: ' |
|
379 | b'finished migrating %d changelog revisions; change in size: ' |
General Comments 0
You need to be logged in to leave comments.
Login now