Patchwork [5,of,5,filtering,part,2,V2] clfilter: fix `nodemap` usage in `getbundle`

mail settings
Submitter Pierre-Yves David
Date Dec. 10, 2012, 5:30 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/41/
State Superseded, archived
Commit 739c88ff043c10edfaf741cbac64901f47c10e5d
Headers show


Pierre-Yves David - Dec. 10, 2012, 5:30 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at>
# Date 1355159561 -3600
# Node ID 6e54226c69bb73b0f8f140560379e3eeefcffd9c
# Parent  0ffb3f54b38648807bb24f020db9fbde84615c52
clfilter: fix `nodemap` usage in `getbundle`

With the current implementation, `changelog.nodemap` is not filtered. So some
filtered changeset in common are not filtered by `n in nodemap`. This leads to
crash lower in the stack when the bundle generation try to access those node on
a filtered changelog.


diff --git a/mercurial/ b/mercurial/
--- a/mercurial/
+++ b/mercurial/
@@ -2198,12 +2198,12 @@  class localrepository(object):
         The nodes in common might not all be known locally due to the way the
         current discovery protocol works.
         cl = self.changelog
         if common:
-            nm = cl.nodemap
-            common = [n for n in common if n in nm]
+            hasnode = cl.hasnode
+            common = [n for n in common if hasnode(n)]
             common = [nullid]
         if not heads:
             heads = cl.heads()
         return self.getlocalbundle(source,