Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revlog.py @ 14523:b4175b72bbd8
revlog: bail out earlier in group when we have no chunks
author | Sune Foldager <cryo@cyanite.org> |
---|---|
date | Fri, 03 Jun 2011 20:32:54 +0200 |
parents | 1ffeeb91c55d |
children | 48ec0763afbb |
comparison
equal
deleted
inserted
replaced
14522:5ca61ef6ff00 | 14523:b4175b72bbd8 |
---|---|
1094 guaranteed to have this parent as it has all history before | 1094 guaranteed to have this parent as it has all history before |
1095 these changesets. In the case firstparent is nullrev the | 1095 these changesets. In the case firstparent is nullrev the |
1096 changegroup starts with a full revision. | 1096 changegroup starts with a full revision. |
1097 """ | 1097 """ |
1098 | 1098 |
1099 # if we don't have any revisions touched by these changesets, bail | |
1100 if len(nodelist) == 0: | |
1101 yield bundler.close() | |
1102 return | |
1103 | |
1099 # for generaldelta revlogs, we linearize the revs; this will both be | 1104 # for generaldelta revlogs, we linearize the revs; this will both be |
1100 # much quicker and generate a much smaller bundle | 1105 # much quicker and generate a much smaller bundle |
1101 if (self._generaldelta and reorder is not False) or reorder: | 1106 if (self._generaldelta and reorder is not False) or reorder: |
1102 dag = dagutil.revlogdag(self) | 1107 dag = dagutil.revlogdag(self) |
1103 revs = set(self.rev(n) for n in nodelist) | 1108 revs = set(self.rev(n) for n in nodelist) |
1104 revs = dag.linearize(revs) | 1109 revs = dag.linearize(revs) |
1105 else: | 1110 else: |
1106 revs = sorted([self.rev(n) for n in nodelist]) | 1111 revs = sorted([self.rev(n) for n in nodelist]) |
1107 | |
1108 # if we don't have any revisions touched by these changesets, bail | |
1109 if not revs: | |
1110 yield bundler.close() | |
1111 return | |
1112 | 1112 |
1113 # add the parent of the first rev | 1113 # add the parent of the first rev |
1114 p = self.parentrevs(revs[0])[0] | 1114 p = self.parentrevs(revs[0])[0] |
1115 revs.insert(0, p) | 1115 revs.insert(0, p) |
1116 | 1116 |