changegroup: change topics during generation
authorGregory Szorc <gregory.szorc@gmail.com>
Fri, 10 Aug 2018 13:43:26 -0700
changeset 39239 0617a700ef7b
parent 39238 cc957b9dc335
child 39240 2af6b2d8d1d8
changegroup: change topics during generation Changegroup generation and consumption currently uses different sets of topics. Generation uses "bundling" and consumption uses the name of the thing being consumed. This commit makes the topic and unit names consistent on both ends. The reason I chose to change the generation side is because when "bundling" is used for 3 different stages, it is unclear which stage of changegroup generation we're in. By making the topics "changesets," "manifests," and "files," one can get a better feel for how far along in the bundling process we are. Differential Revision: https://phab.mercurial-scm.org/D4272
mercurial/changegroup.py
tests/test-bundle.t
tests/test-bundle2-format.t
--- a/mercurial/changegroup.py	Fri Aug 10 12:44:15 2018 -0700
+++ b/mercurial/changegroup.py	Fri Aug 10 13:43:26 2018 -0700
@@ -658,15 +658,15 @@
 
 def deltagroup(repo, store, nodes, ischangelog, lookup, forcedeltaparentprev,
                allowreorder,
-               units=None,
+               topic=None,
                ellipses=False, clrevtolocalrev=None, fullclnodes=None,
                precomputedellipsis=None):
     """Calculate deltas for a set of revisions.
 
     Is a generator of ``revisiondelta`` instances.
 
-    If units is not None, progress detail will be generated, units specifies
-    the type of revlog that is touched (changelog, manifest, etc.).
+    If topic is not None, progress detail will be generated using this
+    topic name (e.g. changesets, manifests, etc).
     """
     if not nodes:
         return
@@ -743,8 +743,8 @@
     # We expect the first pass to be fast, so we only engage the progress
     # meter for constructing the revision deltas.
     progress = None
-    if units is not None:
-        progress = repo.ui.makeprogress(_('bundling'), unit=units,
+    if topic is not None:
+        progress = repo.ui.makeprogress(topic, unit=_('chunks'),
                                         total=len(requests))
 
     for i, delta in enumerate(store.emitrevisiondeltas(requests)):
@@ -1002,7 +1002,7 @@
             # Reorder settings are currently ignored for changelog.
             True,
             ellipses=self._ellipses,
-            units=_('changesets'),
+            topic=_('changesets'),
             clrevtolocalrev={},
             fullclnodes=self._fullclnodes,
             precomputedellipsis=self._precomputedellipsis)
@@ -1083,7 +1083,7 @@
                 self._repo, store, prunednodes, False, lookupfn,
                 self._forcedeltaparentprev, self._reorder,
                 ellipses=self._ellipses,
-                units=_('manifests'),
+                topic=_('manifests'),
                 clrevtolocalrev=clrevtolocalrev,
                 fullclnodes=self._fullclnodes,
                 precomputedellipsis=self._precomputedellipsis)
@@ -1140,7 +1140,7 @@
             linknodes = normallinknodes
 
         repo = self._repo
-        progress = repo.ui.makeprogress(_('bundling'), unit=_('files'),
+        progress = repo.ui.makeprogress(_('files'), unit=_('files'),
                                         total=len(changedfiles))
         for i, fname in enumerate(sorted(changedfiles)):
             filerevlog = repo.file(fname)
--- a/tests/test-bundle.t	Fri Aug 10 12:44:15 2018 -0700
+++ b/tests/test-bundle.t	Fri Aug 10 13:43:26 2018 -0700
@@ -796,13 +796,13 @@
   057f4db07f61970e1c11e83be79e9d08adc4dc31
   bundle2-output-bundle: "HG20", (1 params) 2 parts total
   bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
-  bundling: 1/2 changesets (50.00%)
-  bundling: 2/2 changesets (100.00%)
-  bundling: 1/2 manifests (50.00%)
-  bundling: 2/2 manifests (100.00%)
-  bundling: b 1/3 files (33.33%)
-  bundling: b1 2/3 files (66.67%)
-  bundling: x 3/3 files (100.00%)
+  changesets: 1/2 chunks (50.00%)
+  changesets: 2/2 chunks (100.00%)
+  manifests: 1/2 chunks (50.00%)
+  manifests: 2/2 chunks (100.00%)
+  files: b 1/3 files (33.33%)
+  files: b1 2/3 files (66.67%)
+  files: x 3/3 files (100.00%)
   bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload
 
 #if repobundlerepo
--- a/tests/test-bundle2-format.t	Fri Aug 10 12:44:15 2018 -0700
+++ b/tests/test-bundle2-format.t	Fri Aug 10 13:43:26 2018 -0700
@@ -873,17 +873,17 @@
   bundle2-output-part: "changegroup" (advisory) streamed payload
   bundle2-output: part 0: "changegroup"
   bundle2-output: header chunk size: 18
-  bundling: 1/4 changesets (25.00%)
-  bundling: 2/4 changesets (50.00%)
-  bundling: 3/4 changesets (75.00%)
-  bundling: 4/4 changesets (100.00%)
-  bundling: 1/4 manifests (25.00%)
-  bundling: 2/4 manifests (50.00%)
-  bundling: 3/4 manifests (75.00%)
-  bundling: 4/4 manifests (100.00%)
-  bundling: D 1/3 files (33.33%)
-  bundling: E 2/3 files (66.67%)
-  bundling: H 3/3 files (100.00%)
+  changesets: 1/4 chunks (25.00%)
+  changesets: 2/4 chunks (50.00%)
+  changesets: 3/4 chunks (75.00%)
+  changesets: 4/4 chunks (100.00%)
+  manifests: 1/4 chunks (25.00%)
+  manifests: 2/4 chunks (50.00%)
+  manifests: 3/4 chunks (75.00%)
+  manifests: 4/4 chunks (100.00%)
+  files: D 1/3 files (33.33%)
+  files: E 2/3 files (66.67%)
+  files: H 3/3 files (100.00%)
   bundle2-output: payload chunk size: 1555
   bundle2-output: closing payload chunk
   bundle2-output: end of bundle