Show More
@@ -66,6 +66,10 b' def closechunk():' | |||
|
66 | 66 | """return a changegroup chunk header (string) for a zero-length chunk""" |
|
67 | 67 | return struct.pack(">l", 0) |
|
68 | 68 | |
|
69 | def _fileheader(path): | |
|
70 | """Obtain a changegroup chunk header for a named path.""" | |
|
71 | return chunkheader(len(path)) + path | |
|
72 | ||
|
69 | 73 | def writechunks(ui, chunks, filename, vfs=None): |
|
70 | 74 | """Write chunks to a file and return its filename. |
|
71 | 75 | |
@@ -606,9 +610,6 b' class cgpacker(object):' | |||
|
606 | 610 | |
|
607 | 611 | return closechunk() |
|
608 | 612 | |
|
609 | def _fileheader(self, fname): | |
|
610 | return chunkheader(len(fname)) + fname | |
|
611 | ||
|
612 | 613 | # Extracted both for clarity and for overriding in extensions. |
|
613 | 614 | def _sortgroup(self, store, ischangelog, nodelist, lookup): |
|
614 | 615 | """Sort nodes for change group and turn them into revnums.""" |
@@ -701,7 +702,7 b' class cgpacker(object):' | |||
|
701 | 702 | |
|
702 | 703 | if dir: |
|
703 | 704 | assert self.version == b'03' |
|
704 |
yield |
|
|
705 | yield _fileheader(dir) | |
|
705 | 706 | |
|
706 | 707 | # TODO violates storage abstractions by assuming revlogs. |
|
707 | 708 | dirlog = self._repo.manifestlog._revlog.dirlog(dir) |
@@ -981,7 +982,7 b' class cgpacker(object):' | |||
|
981 | 982 | filenodes = self._prune(filerevlog, linkrevnodes, commonrevs) |
|
982 | 983 | if filenodes: |
|
983 | 984 | progress.update(i + 1, item=fname) |
|
984 |
h = |
|
|
985 | h = _fileheader(fname) | |
|
985 | 986 | size = len(h) |
|
986 | 987 | yield h |
|
987 | 988 | for chunk in self.group(filenodes, filerevlog, False, |
General Comments 0
You need to be logged in to leave comments.
Login now