Patchwork D9665: engine: refactor how total dstsize is calculated

login
register
mail settings
Submitter phabricator
Date Dec. 30, 2020, 11:53 a.m.
Message ID <differential-rev-PHID-DREV-dhjsa3tcrfwfmky4yoni-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47976/
State Superseded
Headers show

Comments

phabricator - Dec. 30, 2020, 11:53 a.m.
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Instead of increasing it with each revlog, we just get the sum of total
  destination changelog, manifest and filelogs sizes.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9665

AFFECTED FILES
  mercurial/upgrade_utils/engine.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/upgrade_utils/engine.py b/mercurial/upgrade_utils/engine.py
--- a/mercurial/upgrade_utils/engine.py
+++ b/mercurial/upgrade_utils/engine.py
@@ -285,9 +285,7 @@ 
             oncopiedrevision,
         )
         info = newrl.storageinfo(storedsize=True)
-        datasize = info[b'storedsize'] or 0
-        dstsize += datasize
-        fdstsize += datasize
+        fdstsize += info[b'storedsize'] or 0
     ui.status(
         _(
             b'finished migrating %d filelog revisions across %d '
@@ -328,9 +326,7 @@ 
             oncopiedrevision,
         )
         info = newrl.storageinfo(storedsize=True)
-        datasize = info[b'storedsize'] or 0
-        dstsize += datasize
-        mdstsize += datasize
+        mdstsize += info[b'storedsize'] or 0
     ui.status(
         _(
             b'finished migrating %d manifest revisions across %d '
@@ -370,9 +366,7 @@ 
             oncopiedrevision,
         )
         info = newrl.storageinfo(storedsize=True)
-        datasize = info[b'storedsize'] or 0
-        dstsize += datasize
-        cdstsize += datasize
+        cdstsize += info[b'storedsize'] or 0
     progress.complete()
     ui.status(
         _(
@@ -382,6 +376,7 @@ 
         % (crevcount, util.bytecount(cdstsize - csrcsize))
     )
 
+    dstsize = fdstsize + mdstsize + cdstsize
     ui.status(
         _(
             b'finished migrating %d total revisions; total change in store '