comparison states.py @ 29:52c227772dad

fix nodestate computation
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Thu, 07 Jul 2011 11:24:33 +0200
parents 0918e3b54f0b
children a2189159e92f
comparison
equal deleted inserted replaced
28:0918e3b54f0b 29:52c227772dad
226 o_writejournal = repo._writejournal 226 o_writejournal = repo._writejournal
227 class statefulrepo(repo.__class__): 227 class statefulrepo(repo.__class__):
228 228
229 def nodestate(self, node): 229 def nodestate(self, node):
230 rev = self.changelog.rev(node) 230 rev = self.changelog.rev(node)
231 for state in STATES[::-1]: 231 for state in STATES:
232 # XXX avoid for untracked heads 232 # XXX avoid for untracked heads
233 if state.next is not None: 233 if state.next is not None:
234 for head in self.stateheads(state): 234 revs = scmutil.revrange(self, ["::%s()" % state.headssymbol])
235 revhead = self.changelog.rev(head) 235 if rev in revs:
236 if self.changelog.descendant(revhead, rev): 236 break
237 return state.next
238 return state 237 return state
239 238
240 239
241 240
242 def stateheads(self, state): 241 def stateheads(self, state):