Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/upgrade_utils/engine.py @ 46214:5dfa837d933e
engine: refactor how total dstsize is calculated
Instead of increasing it with each revlog, we just get the sum of total
destination changelog, manifest and filelogs sizes.
Differential Revision: https://phab.mercurial-scm.org/D9665
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Wed, 30 Dec 2020 16:11:24 +0530 |
parents | 6b40aac4da8e |
children | 82f3ee1a505f |
comparison
equal
deleted
inserted
replaced
46213:30310886d423 | 46214:5dfa837d933e |
---|---|
283 revlogs, | 283 revlogs, |
284 sidedatacompanion, | 284 sidedatacompanion, |
285 oncopiedrevision, | 285 oncopiedrevision, |
286 ) | 286 ) |
287 info = newrl.storageinfo(storedsize=True) | 287 info = newrl.storageinfo(storedsize=True) |
288 datasize = info[b'storedsize'] or 0 | 288 fdstsize += info[b'storedsize'] or 0 |
289 dstsize += datasize | |
290 fdstsize += datasize | |
291 ui.status( | 289 ui.status( |
292 _( | 290 _( |
293 b'finished migrating %d filelog revisions across %d ' | 291 b'finished migrating %d filelog revisions across %d ' |
294 b'filelogs; change in size: %s\n' | 292 b'filelogs; change in size: %s\n' |
295 ) | 293 ) |
326 revlogs, | 324 revlogs, |
327 sidedatacompanion, | 325 sidedatacompanion, |
328 oncopiedrevision, | 326 oncopiedrevision, |
329 ) | 327 ) |
330 info = newrl.storageinfo(storedsize=True) | 328 info = newrl.storageinfo(storedsize=True) |
331 datasize = info[b'storedsize'] or 0 | 329 mdstsize += info[b'storedsize'] or 0 |
332 dstsize += datasize | |
333 mdstsize += datasize | |
334 ui.status( | 330 ui.status( |
335 _( | 331 _( |
336 b'finished migrating %d manifest revisions across %d ' | 332 b'finished migrating %d manifest revisions across %d ' |
337 b'manifests; change in size: %s\n' | 333 b'manifests; change in size: %s\n' |
338 ) | 334 ) |
368 revlogs, | 364 revlogs, |
369 sidedatacompanion, | 365 sidedatacompanion, |
370 oncopiedrevision, | 366 oncopiedrevision, |
371 ) | 367 ) |
372 info = newrl.storageinfo(storedsize=True) | 368 info = newrl.storageinfo(storedsize=True) |
373 datasize = info[b'storedsize'] or 0 | 369 cdstsize += info[b'storedsize'] or 0 |
374 dstsize += datasize | |
375 cdstsize += datasize | |
376 progress.complete() | 370 progress.complete() |
377 ui.status( | 371 ui.status( |
378 _( | 372 _( |
379 b'finished migrating %d changelog revisions; change in size: ' | 373 b'finished migrating %d changelog revisions; change in size: ' |
380 b'%s\n' | 374 b'%s\n' |
381 ) | 375 ) |
382 % (crevcount, util.bytecount(cdstsize - csrcsize)) | 376 % (crevcount, util.bytecount(cdstsize - csrcsize)) |
383 ) | 377 ) |
384 | 378 |
379 dstsize = fdstsize + mdstsize + cdstsize | |
385 ui.status( | 380 ui.status( |
386 _( | 381 _( |
387 b'finished migrating %d total revisions; total change in store ' | 382 b'finished migrating %d total revisions; total change in store ' |
388 b'size: %s\n' | 383 b'size: %s\n' |
389 ) | 384 ) |