diff hgext3rd/pullbundle.py @ 4133:1293625d274d

pullbundle: add an output about the time spent slicing the set This will be useful to monitor overall performance.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 23 Sep 2018 22:58:11 +0200
parents afc933d32085
children ab77f37fedf3
line wrap: on
line diff
--- a/hgext3rd/pullbundle.py	Sun Sep 23 22:45:23 2018 +0200
+++ b/hgext3rd/pullbundle.py	Sun Sep 23 22:58:11 2018 +0200
@@ -131,7 +131,13 @@
         makeonecgpart(newpart, repo, None, outgoing, version, source, bundlecaps,
                       filematcher, cgversions)
     else:
-        for sliceid, sliceout in sliceoutgoing(repo, outgoing):
+        start = util.timer()
+        slices = sliceoutgoing(repo, outgoing)
+        end = util.timer()
+        msg = _('pullbundle-cache: "missing" set sliced into %d subranges '
+                'in %s seconds\n')
+        repo.ui.write(msg % (len(slices), end - start))
+        for sliceid, sliceout in slices:
             makeonecgpart(newpart, repo, sliceid, sliceout, version, source, bundlecaps,
                           filematcher, cgversions)