[PATCH 3 of 3] changegroup: switch to manifestctx.readstoragenewnodes() (issue5367)
Gregory Szorc
gregory.szorc at gmail.com
Tue Mar 14 15:33:08 EDT 2017
# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1489519968 25200
# Tue Mar 14 12:32:48 2017 -0700
# Node ID 58091ccc1d551152d4c135db1a394c1763bb24c4
# Parent c130f8c7496a823c92d3d71880e5beb9fb60c0f7
changegroup: switch to manifestctx.readstoragenewnodes() (issue5367)
readdelta() could return a delta against an empty manifest, which
would result in scanning every single file in the manifest.
We now have an API for returning a more minimal delta. So we
switch to it.
diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -338,9 +338,9 @@ class cg1unpacker(object):
# validate incoming csets have their manifests
for cset in xrange(clstart, clend):
mfnode = cl.changelogrevision(cset).manifest
- mfest = ml[mfnode].readdelta()
- # store file nodes we must see
- for f, n in mfest.iteritems():
+ # Find new nodes referenced by the manifest so we
+ # can verify they exist later.
+ for f, n in ml[mfnode].readstoragenewnodes():
needfiles.setdefault(f, set()).add(n)
# process the files
More information about the Mercurial-devel
mailing list