# HG changeset patch # User Augie Fackler # Date 1449244546 18000 # Node ID 65c47779bcb5154b98a1d91415236ead783b173b # Parent c3dc03109401c24b9898c24a9489f81303c136d1 changegroup: remove one special case from lookupmflinknode In the fastpathlinkrev case, lookupmflinknode was a very complicated way of saying mfs.__getitem__, so let's just get that case out of our way so it's easier to understand what's going on. diff -r c3dc03109401 -r 65c47779bcb5 mercurial/changegroup.py --- a/mercurial/changegroup.py Fri Dec 04 10:35:45 2015 -0500 +++ b/mercurial/changegroup.py Fri Dec 04 10:55:46 2015 -0500 @@ -656,21 +656,23 @@ # Callback for the manifest, used to collect linkrevs for filelog # revisions. # Returns the linkrev node (collected in lookupcl). - def lookupmflinknode(x): - """Callback for looking up the linknode for manifests. + if fastpathlinkrev: + lookupmflinknode = mfs.__getitem__ + else: + def lookupmflinknode(x): + """Callback for looking up the linknode for manifests. - Returns the linkrev node for the specified manifest. - - SIDE EFFECT: + Returns the linkrev node for the specified manifest. - fclnodes gets populated with the list of relevant - file nodes if we're not using fastpathlinkrev. + SIDE EFFECT: + + fclnodes gets populated with the list of relevant + file nodes. - Note that this means you can't trust fclnodes until - after manifests have been sent to the client. - """ - clnode = mfs[x] - if not fastpathlinkrev: + Note that this means you can't trust fclnodes until + after manifests have been sent to the client. + """ + clnode = mfs[x] mdata = ml.readfast(x) for f in mfchangedfiles[x]: try: @@ -683,7 +685,7 @@ fclnode = fclnodes.setdefault(n, clnode) if clrevorder[clnode] < clrevorder[fclnode]: fclnodes[n] = clnode - return clnode + return clnode mfnodes = self.prune(ml, mfs, commonrevs) for x in self._packmanifests(mfnodes, lookupmflinknode):