mercurial/changegroup.py
changeset 27239 65c47779bcb5
parent 27238 c3dc03109401
child 27240 94a3d6fdc315
equal deleted inserted replaced
27238:c3dc03109401 27239:65c47779bcb5
   654         # This was also fixed in cc0ff93d0c0c.
   654         # This was also fixed in cc0ff93d0c0c.
   655         fastpathlinkrev = fastpathlinkrev and not self._reorder
   655         fastpathlinkrev = fastpathlinkrev and not self._reorder
   656         # Callback for the manifest, used to collect linkrevs for filelog
   656         # Callback for the manifest, used to collect linkrevs for filelog
   657         # revisions.
   657         # revisions.
   658         # Returns the linkrev node (collected in lookupcl).
   658         # Returns the linkrev node (collected in lookupcl).
   659         def lookupmflinknode(x):
   659         if fastpathlinkrev:
   660             """Callback for looking up the linknode for manifests.
   660             lookupmflinknode = mfs.__getitem__
   661 
   661         else:
   662             Returns the linkrev node for the specified manifest.
   662             def lookupmflinknode(x):
   663 
   663                 """Callback for looking up the linknode for manifests.
   664             SIDE EFFECT:
   664 
   665 
   665                 Returns the linkrev node for the specified manifest.
   666               fclnodes gets populated with the list of relevant
   666 
   667               file nodes if we're not using fastpathlinkrev.
   667                 SIDE EFFECT:
   668 
   668 
   669             Note that this means you can't trust fclnodes until
   669                   fclnodes gets populated with the list of relevant
   670             after manifests have been sent to the client.
   670                   file nodes.
   671             """
   671 
   672             clnode = mfs[x]
   672                 Note that this means you can't trust fclnodes until
   673             if not fastpathlinkrev:
   673                 after manifests have been sent to the client.
       
   674                 """
       
   675                 clnode = mfs[x]
   674                 mdata = ml.readfast(x)
   676                 mdata = ml.readfast(x)
   675                 for f in mfchangedfiles[x]:
   677                 for f in mfchangedfiles[x]:
   676                     try:
   678                     try:
   677                         n = mdata[f]
   679                         n = mdata[f]
   678                     except KeyError:
   680                     except KeyError:
   681                     # version
   683                     # version
   682                     fclnodes = fnodes.setdefault(f, {})
   684                     fclnodes = fnodes.setdefault(f, {})
   683                     fclnode = fclnodes.setdefault(n, clnode)
   685                     fclnode = fclnodes.setdefault(n, clnode)
   684                     if clrevorder[clnode] < clrevorder[fclnode]:
   686                     if clrevorder[clnode] < clrevorder[fclnode]:
   685                         fclnodes[n] = clnode
   687                         fclnodes[n] = clnode
   686             return clnode
   688                 return clnode
   687 
   689 
   688         mfnodes = self.prune(ml, mfs, commonrevs)
   690         mfnodes = self.prune(ml, mfs, commonrevs)
   689         for x in self._packmanifests(mfnodes, lookupmflinknode):
   691         for x in self._packmanifests(mfnodes, lookupmflinknode):
   690             yield x
   692             yield x
   691 
   693