D4639: narrow: don't send the changelog information when widening without ellipses
pulkit (Pulkit Goyal)
phabricator at mercurial-scm.org
Tue Sep 18 10:44:04 UTC 2018
pulkit created this revision.
Herald added a reviewer: durin42.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
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.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D4639
AFFECTED FILES
hgext/narrow/narrowbundle2.py
hgext/narrow/narrowcommands.py
tests/test-narrow-widen-no-ellipsis.t
CHANGE DETAILS
diff --git a/tests/test-narrow-widen-no-ellipsis.t b/tests/test-narrow-widen-no-ellipsis.t
--- a/tests/test-narrow-widen-no-ellipsis.t
+++ b/tests/test-narrow-widen-no-ellipsis.t
@@ -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
diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py
--- a/hgext/narrow/narrowcommands.py
+++ b/hgext/narrow/narrowcommands.py
@@ -260,14 +260,16 @@
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
p1, p2 = ds.p1(), ds.p2()
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 --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py
--- a/hgext/narrow/narrowbundle2.py
+++ b/hgext/narrow/narrowbundle2.py
@@ -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)
To: pulkit, durin42, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list