Show More
@@ -819,19 +819,9 b' class cgpacker(object):' | |||||
819 | mfs.clear() |
|
819 | mfs.clear() | |
820 | clrevs = set(cl.rev(x) for x in clnodes) |
|
820 | clrevs = set(cl.rev(x) for x in clnodes) | |
821 |
|
821 | |||
822 | if not fastpathlinkrev: |
|
822 | for chunk in self.generatefiles(changedfiles, commonrevs, | |
823 | def linknodes(unused, fname): |
|
823 | source, mfdicts, fastpathlinkrev, | |
824 | return fnodes.get(fname, {}) |
|
824 | fnodes, clrevs): | |
825 | else: |
|
|||
826 | cln = cl.node |
|
|||
827 | def linknodes(filerevlog, fname): |
|
|||
828 | llr = filerevlog.linkrev |
|
|||
829 | fln = filerevlog.node |
|
|||
830 | revs = ((r, llr(r)) for r in filerevlog) |
|
|||
831 | return dict((fln(r), cln(lr)) for r, lr in revs if lr in clrevs) |
|
|||
832 |
|
||||
833 | for chunk in self.generatefiles(changedfiles, linknodes, commonrevs, |
|
|||
834 | source, mfdicts): |
|
|||
835 | yield chunk |
|
825 | yield chunk | |
836 |
|
826 | |||
837 | yield self._close() |
|
827 | yield self._close() | |
@@ -986,16 +976,28 b' class cgpacker(object):' | |||||
986 | yield self._manifestsend |
|
976 | yield self._manifestsend | |
987 |
|
977 | |||
988 | # The 'source' parameter is useful for extensions |
|
978 | # The 'source' parameter is useful for extensions | |
989 |
def generatefiles(self, changedfiles, |
|
979 | def generatefiles(self, changedfiles, commonrevs, source, | |
990 | mfdicts): |
|
980 | mfdicts, fastpathlinkrev, fnodes, clrevs): | |
991 | changedfiles = list(filter(self._filematcher, changedfiles)) |
|
981 | changedfiles = list(filter(self._filematcher, changedfiles)) | |
992 |
|
982 | |||
|
983 | if not fastpathlinkrev: | |||
|
984 | def normallinknodes(unused, fname): | |||
|
985 | return fnodes.get(fname, {}) | |||
|
986 | else: | |||
|
987 | cln = self._repo.changelog.node | |||
|
988 | ||||
|
989 | def normallinknodes(store, fname): | |||
|
990 | flinkrev = store.linkrev | |||
|
991 | fnode = store.node | |||
|
992 | revs = ((r, flinkrev(r)) for r in store) | |||
|
993 | return dict((fnode(r), cln(lr)) | |||
|
994 | for r, lr in revs if lr in clrevs) | |||
|
995 | ||||
993 | if self._isshallow: |
|
996 | if self._isshallow: | |
994 | # In a shallow clone, the linknodes callback needs to also include |
|
997 | # In a shallow clone, the linknodes callback needs to also include | |
995 | # those file nodes that are in the manifests we sent but weren't |
|
998 | # those file nodes that are in the manifests we sent but weren't | |
996 | # introduced by those manifests. |
|
999 | # introduced by those manifests. | |
997 | commonctxs = [self._repo[c] for c in commonrevs] |
|
1000 | commonctxs = [self._repo[c] for c in commonrevs] | |
998 | oldlinknodes = linknodes |
|
|||
999 | clrev = self._repo.changelog.rev |
|
1001 | clrev = self._repo.changelog.rev | |
1000 |
|
1002 | |||
1001 | # Defining this function has a side-effect of overriding the |
|
1003 | # Defining this function has a side-effect of overriding the | |
@@ -1008,7 +1010,7 b' class cgpacker(object):' | |||||
1008 | self._clrevtolocalrev[c.rev()] = flog.rev(fnode) |
|
1010 | self._clrevtolocalrev[c.rev()] = flog.rev(fnode) | |
1009 | except error.ManifestLookupError: |
|
1011 | except error.ManifestLookupError: | |
1010 | pass |
|
1012 | pass | |
1011 |
links = ol |
|
1013 | links = normallinknodes(flog, fname) | |
1012 | if len(links) != len(mfdicts): |
|
1014 | if len(links) != len(mfdicts): | |
1013 | for mf, lr in mfdicts: |
|
1015 | for mf, lr in mfdicts: | |
1014 | fnode = mf.get(fname, None) |
|
1016 | fnode = mf.get(fname, None) | |
@@ -1017,6 +1019,8 b' class cgpacker(object):' | |||||
1017 | elif fnode: |
|
1019 | elif fnode: | |
1018 | links[fnode] = lr |
|
1020 | links[fnode] = lr | |
1019 | return links |
|
1021 | return links | |
|
1022 | else: | |||
|
1023 | linknodes = normallinknodes | |||
1020 |
|
1024 | |||
1021 | return self._generatefiles(changedfiles, linknodes, commonrevs, source) |
|
1025 | return self._generatefiles(changedfiles, linknodes, commonrevs, source) | |
1022 |
|
1026 |
General Comments 0
You need to be logged in to leave comments.
Login now