narrow: don't send the changelog information when widening without ellipses
authorPulkit Goyal <pulkit@yandex-team.ru>
Tue, 18 Sep 2018 13:41:16 +0300
changeset 39673 f1844a10ee19
parent 39672 a1942015c10e
child 39674 3e8952c0cb45
narrow: don't send the changelog information when widening without ellipses When we widen anon-ellipses narrow copy, the server sends the changelog information of all the changesets. The code was copied from ellipses case and in ellipses cases, it's required to send the new changelog data. But in non-ellipses cases, we don't need to send the changelog data as we will have all the changesets locally. Before this patch, there was a overhead of ~8-10 mins on each widening call because of all the changelog information being pulled and being applied. After this patch, we no more pull the changelog information. So this patch can save ~5 mins on Mozilla repo on each widening and more on repos which have more changesets. When we apply an empty changelog from changegroup, there is a devel-warn. This patch kind of hacks to silence that devel-warn. Differential Revision: https://phab.mercurial-scm.org/D4639
hgext/narrow/narrowbundle2.py
hgext/narrow/narrowcommands.py
tests/test-narrow-widen-no-ellipsis.t
--- a/hgext/narrow/narrowbundle2.py	Mon Sep 17 21:41:34 2018 +0300
+++ b/hgext/narrow/narrowbundle2.py	Tue Sep 18 13:41:16 2018 +0300
@@ -91,7 +91,7 @@
                                             filematcher=diffmatch,
                                             fullnodes=commonnodes)
             cgdata = packer.generate(set([nullid]), list(commonnodes), False,
-                    source)
+                                     source, changelog=False)
 
             part = bundler.newpart('changegroup', data=cgdata)
             part.addparam('version', version)
--- a/hgext/narrow/narrowcommands.py	Mon Sep 17 21:41:34 2018 +0300
+++ b/hgext/narrow/narrowcommands.py	Tue Sep 18 13:41:16 2018 +0300
@@ -260,6 +260,8 @@
     def setnewnarrowpats():
         repo.setnarrowpats(newincludes, newexcludes)
     repo.setnewnarrowpats = setnewnarrowpats
+    # silence the devel-warning of applying an empty changegroup
+    overrides = {('devel', 'all-warnings'): False}
 
     with ui.uninterruptable():
         ds = repo.dirstate
@@ -267,7 +269,7 @@
         with ds.parentchange():
             ds.setparents(node.nullid, node.nullid)
         common = commoninc[0]
-        with wrappedextraprepare:
+        with wrappedextraprepare, repo.ui.configoverride(overrides, 'widen'):
             exchange.pull(repo, remote, heads=common)
         with ds.parentchange():
             ds.setparents(p1, p2)
--- a/tests/test-narrow-widen-no-ellipsis.t	Mon Sep 17 21:41:34 2018 +0300
+++ b/tests/test-narrow-widen-no-ellipsis.t	Tue Sep 18 13:41:16 2018 +0300
@@ -106,9 +106,6 @@
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "changegroup" (params: * mandatory) supported (glob)
   adding changesets
-  add changeset * (glob)
-  add changeset * (glob)
-  add changeset * (glob)
   adding manifests
   adding widest/ revisions (tree !)
   adding file changes