D4859: exchangev2: add progress bar around manifest scanning

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Wed Oct 3 14:58:20 EDT 2018


indygreg updated this revision to Diff 11651.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4859?vs=11637&id=11651

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

AFFECTED FILES
  mercurial/exchangev2.py

CHANGE DETAILS

diff --git a/mercurial/exchangev2.py b/mercurial/exchangev2.py
--- a/mercurial/exchangev2.py
+++ b/mercurial/exchangev2.py
@@ -320,19 +320,25 @@
     ml = repo.manifestlog
     fnodes = collections.defaultdict(dict)
 
-    for manifestnode in manifestnodes:
-        m = ml.get(b'', manifestnode)
+    progress = repo.ui.makeprogress(
+        _('scanning manifests'), total=len(manifestnodes))
+
+    with progress:
+        for manifestnode in manifestnodes:
+            m = ml.get(b'', manifestnode)
 
-        # TODO this will pull in unwanted nodes because it takes the storage
-        # delta into consideration. What we really want is something that takes
-        # the delta between the manifest's parents. And ideally we would
-        # ignore file nodes that are known locally. For now, ignore both
-        # these limitations. This will result in incremental fetches requesting
-        # data we already have. So this is far from ideal.
-        md = m.readfast()
+            # TODO this will pull in unwanted nodes because it takes the storage
+            # delta into consideration. What we really want is something that takes
+            # the delta between the manifest's parents. And ideally we would
+            # ignore file nodes that are known locally. For now, ignore both
+            # these limitations. This will result in incremental fetches requesting
+            # data we already have. So this is far from ideal.
+            md = m.readfast()
 
-        for path, fnode in md.items():
-            fnodes[path].setdefault(fnode, manifestnode)
+            for path, fnode in md.items():
+                fnodes[path].setdefault(fnode, manifestnode)
+
+            progress.increment()
 
     return fnodes
 



To: indygreg, #hg-reviewers
Cc: martinvonz, mercurial-devel


More information about the Mercurial-devel mailing list