##// END OF EJS Templates
phases: move pure phase computation in a function
Laurent Charignon -
r24519:de3acfab default
parent child Browse files
Show More
@@ -179,11 +179,7 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 getphaserevs(self, repo):
182 def computephaserevspure(self, repo):
183 if self._phaserevs is None:
184 try:
185 self._phaserevs = self.getphaserevsnative(repo)
186 except AttributeError:
187 repo = repo.unfiltered()
183 repo = repo.unfiltered()
188 revs = [public] * len(repo.changelog)
184 revs = [public] * len(repo.changelog)
189 self._phaserevs = revs
185 self._phaserevs = revs
@@ -195,6 +191,13 class phasecache(object):
195 revs[rev] = phase
191 revs[rev] = phase
196 for rev in repo.changelog.descendants(roots):
192 for rev in repo.changelog.descendants(roots):
197 revs[rev] = phase
193 revs[rev] = phase
194
195 def getphaserevs(self, repo):
196 if self._phaserevs is None:
197 try:
198 self._phaserevs = self.getphaserevsnative(repo)
199 except AttributeError:
200 self.computephaserevspure(repo)
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