##// END OF EJS Templates
phases: move pure phase computation in a function
Laurent Charignon -
r24519:de3acfab default
parent child Browse files
Show More
@@ -179,22 +179,25 b' class phasecache(object):'
179 nativeroots.append(map(repo.changelog.rev, self.phaseroots[phase]))
179 nativeroots.append(map(repo.changelog.rev, self.phaseroots[phase]))
180 return repo.changelog.computephases(nativeroots)
180 return repo.changelog.computephases(nativeroots)
181
181
182 def computephaserevspure(self, repo):
183 repo = repo.unfiltered()
184 revs = [public] * len(repo.changelog)
185 self._phaserevs = revs
186 self._populatephaseroots(repo)
187 for phase in trackedphases:
188 roots = map(repo.changelog.rev, self.phaseroots[phase])
189 if roots:
190 for rev in roots:
191 revs[rev] = phase
192 for rev in repo.changelog.descendants(roots):
193 revs[rev] = phase
194
182 def getphaserevs(self, repo):
195 def getphaserevs(self, repo):
183 if self._phaserevs is None:
196 if self._phaserevs is None:
184 try:
197 try:
185 self._phaserevs = self.getphaserevsnative(repo)
198 self._phaserevs = self.getphaserevsnative(repo)
186 except AttributeError:
199 except AttributeError:
187 repo = repo.unfiltered()
200 self.computephaserevspure(repo)
188 revs = [public] * len(repo.changelog)
189 self._phaserevs = revs
190 self._populatephaseroots(repo)
191 for phase in trackedphases:
192 roots = map(repo.changelog.rev, self.phaseroots[phase])
193 if roots:
194 for rev in roots:
195 revs[rev] = phase
196 for rev in repo.changelog.descendants(roots):
197 revs[rev] = phase
198 return self._phaserevs
201 return self._phaserevs
199
202
200 def invalidate(self):
203 def invalidate(self):
General Comments 0
You need to be logged in to leave comments. Login now