Patchwork [2,of,3,RFC,cg3] changegroup: document manifest linkrev callback some more

login
register
mail settings
Submitter Augie Fackler
Date Dec. 3, 2015, 3:58 p.m.
Message ID <79ad570337631038a08b.1449158316@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/11788/
State Accepted
Delegated to: Martin von Zweigbergk
Headers show

Comments

Augie Fackler - Dec. 3, 2015, 3:58 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1449158165 18000
#      Thu Dec 03 10:56:05 2015 -0500
# Node ID 79ad570337631038a08b75957b2890975221e089
# Parent  b65caadb6a3928729cf8dc81110be59279a7d65a
# EXP-Topic cg3
changegroup: document manifest linkrev callback some more

Martin and I just got super-confused reading some code here, so I
think it's time for some more documentation.
Pierre-Yves David - Dec. 4, 2015, 3:20 a.m.
On 12/03/2015 07:58 AM, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1449158165 18000
> #      Thu Dec 03 10:56:05 2015 -0500
> # Node ID 79ad570337631038a08b75957b2890975221e089
> # Parent  b65caadb6a3928729cf8dc81110be59279a7d65a
> # EXP-Topic cg3
> changegroup: document manifest linkrev callback some more
>
> Martin and I just got super-confused reading some code here, so I
> think it's time for some more documentation.

Patches 1-2 are on the clowncopter.

Patch

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -653,6 +653,18 @@  class cg1packer(object):
         # revisions.
         # Returns the linkrev node (collected in lookupcl).
         def lookupmflinknode(x):
+            """Callback for looking up the linknode for manifests.
+
+            Returns the linkrev node for the specified manifest.
+
+            SIDE EFFECT:
+
+              fclnodes gets populated with the list of relevant
+              file nodes if we're not using fastpathlinkrev.
+
+            Note that this means you can't trust fclnodes until
+            after manifests have been sent to the client.
+            """
             clnode = mfs[x]
             if not fastpathlinkrev:
                 mdata = ml.readfast(x)