Show More
@@ -167,6 +167,8 b' class phasecache(object):' | |||
|
167 | 167 | if self._phaserevs is None: |
|
168 | 168 | repo = repo.unfiltered() |
|
169 | 169 | revs = [public] * len(repo.changelog) |
|
170 | self._phaserevs = revs | |
|
171 | self._populatephaseroots(repo) | |
|
170 | 172 | for phase in trackedphases: |
|
171 | 173 | roots = map(repo.changelog.rev, self.phaseroots[phase]) |
|
172 | 174 | if roots: |
@@ -174,11 +176,21 b' class phasecache(object):' | |||
|
174 | 176 | revs[rev] = phase |
|
175 | 177 | for rev in repo.changelog.descendants(roots): |
|
176 | 178 | revs[rev] = phase |
|
177 | self._phaserevs = revs | |
|
178 | 179 | return self._phaserevs |
|
180 | ||
|
179 | 181 | def invalidate(self): |
|
180 | 182 | self._phaserevs = None |
|
181 | 183 | |
|
184 | def _populatephaseroots(self, repo): | |
|
185 | """Fills the _phaserevs cache with phases for the roots. | |
|
186 | """ | |
|
187 | cl = repo.changelog | |
|
188 | phaserevs = self._phaserevs | |
|
189 | for phase in trackedphases: | |
|
190 | roots = map(cl.rev, self.phaseroots[phase]) | |
|
191 | for root in roots: | |
|
192 | phaserevs[root] = phase | |
|
193 | ||
|
182 | 194 | def phase(self, repo, rev): |
|
183 | 195 | # We need a repo argument here to be able to build _phaserevs |
|
184 | 196 | # if necessary. The repository instance is not stored in |
General Comments 0
You need to be logged in to leave comments.
Login now