Show More
@@ -530,6 +530,17 b' class cg1packer(object):' | |||||
530 | def fileheader(self, fname): |
|
530 | def fileheader(self, fname): | |
531 | return chunkheader(len(fname)) + fname |
|
531 | return chunkheader(len(fname)) + fname | |
532 |
|
532 | |||
|
533 | # Extracted both for clarity and for overriding in extensions. | |||
|
534 | def _sortgroup(self, revlog, nodelist, lookup): | |||
|
535 | """Sort nodes for change group and turn them into revnums.""" | |||
|
536 | # for generaldelta revlogs, we linearize the revs; this will both be | |||
|
537 | # much quicker and generate a much smaller bundle | |||
|
538 | if (revlog._generaldelta and self._reorder is None) or self._reorder: | |||
|
539 | dag = dagutil.revlogdag(revlog) | |||
|
540 | return dag.linearize(set(revlog.rev(n) for n in nodelist)) | |||
|
541 | else: | |||
|
542 | return sorted([revlog.rev(n) for n in nodelist]) | |||
|
543 | ||||
533 | def group(self, nodelist, revlog, lookup, units=None): |
|
544 | def group(self, nodelist, revlog, lookup, units=None): | |
534 | """Calculate a delta group, yielding a sequence of changegroup chunks |
|
545 | """Calculate a delta group, yielding a sequence of changegroup chunks | |
535 | (strings). |
|
546 | (strings). | |
@@ -549,14 +560,7 b' class cg1packer(object):' | |||||
549 | yield self.close() |
|
560 | yield self.close() | |
550 | return |
|
561 | return | |
551 |
|
562 | |||
552 | # for generaldelta revlogs, we linearize the revs; this will both be |
|
563 | revs = self._sortgroup(revlog, nodelist, lookup) | |
553 | # much quicker and generate a much smaller bundle |
|
|||
554 | if (revlog._generaldelta and self._reorder is None) or self._reorder: |
|
|||
555 | dag = dagutil.revlogdag(revlog) |
|
|||
556 | revs = set(revlog.rev(n) for n in nodelist) |
|
|||
557 | revs = dag.linearize(revs) |
|
|||
558 | else: |
|
|||
559 | revs = sorted([revlog.rev(n) for n in nodelist]) |
|
|||
560 |
|
564 | |||
561 | # add the parent of the first rev |
|
565 | # add the parent of the first rev | |
562 | p = revlog.parentrevs(revs[0])[0] |
|
566 | p = revlog.parentrevs(revs[0])[0] |
General Comments 0
You need to be logged in to leave comments.
Login now