# HG changeset patch # User Pulkit Goyal # Date 1537267276 -10800 # Node ID f1844a10ee199f49706a7f361291ecb441d57c30 # Parent a1942015c10e2c670557705f2f0deabff71b0a2f 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 diff -r a1942015c10e -r f1844a10ee19 hgext/narrow/narrowbundle2.py --- 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) diff -r a1942015c10e -r f1844a10ee19 hgext/narrow/narrowcommands.py --- 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) diff -r a1942015c10e -r f1844a10ee19 tests/test-narrow-widen-no-ellipsis.t --- 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