Mercurial > hg
comparison mercurial/changegroup.py @ 26710:730f328624ab
changegroup: rename manifest linknode closure for clarity
Since I'm spending the time to understand this code, I may as well
leave it clearer than I found it.
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 30 Sep 2015 19:59:12 -0400 |
parents | 42733e956887 |
children | 0ef0aec56090 |
comparison
equal
deleted
inserted
replaced
26709:42733e956887 | 26710:730f328624ab |
---|---|
637 # This was also fixed in cc0ff93d0c0c. | 637 # This was also fixed in cc0ff93d0c0c. |
638 fastpathlinkrev = fastpathlinkrev and not self._reorder | 638 fastpathlinkrev = fastpathlinkrev and not self._reorder |
639 # Callback for the manifest, used to collect linkrevs for filelog | 639 # Callback for the manifest, used to collect linkrevs for filelog |
640 # revisions. | 640 # revisions. |
641 # Returns the linkrev node (collected in lookupcl). | 641 # Returns the linkrev node (collected in lookupcl). |
642 def lookupmf(x): | 642 def lookupmflinknode(x): |
643 clnode = mfs[x] | 643 clnode = mfs[x] |
644 if not fastpathlinkrev: | 644 if not fastpathlinkrev: |
645 mdata = ml.readfast(x) | 645 mdata = ml.readfast(x) |
646 for f, n in mdata.iteritems(): | 646 for f, n in mdata.iteritems(): |
647 if f in changedfiles: | 647 if f in changedfiles: |
653 fclnodes[n] = clnode | 653 fclnodes[n] = clnode |
654 return clnode | 654 return clnode |
655 | 655 |
656 mfnodes = self.prune(ml, mfs, commonrevs) | 656 mfnodes = self.prune(ml, mfs, commonrevs) |
657 size = 0 | 657 size = 0 |
658 for chunk in self.group(mfnodes, ml, lookupmf, units=_('manifests')): | 658 for chunk in self.group( |
659 mfnodes, ml, lookupmflinknode, units=_('manifests')): | |
659 size += len(chunk) | 660 size += len(chunk) |
660 yield chunk | 661 yield chunk |
661 self._verbosenote(_('%8.i (manifests)\n') % size) | 662 self._verbosenote(_('%8.i (manifests)\n') % size) |
662 | 663 |
663 mfs.clear() | 664 mfs.clear() |