fix nodestate computation
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Thu, 07 Jul 2011 11:24:33 +0200
changeset 29 52c227772dad
parent 28 0918e3b54f0b
child 30 a2189159e92f
fix nodestate computation
states.py
--- a/states.py	Thu Jul 07 13:44:15 2011 +0200
+++ b/states.py	Thu Jul 07 11:24:33 2011 +0200
@@ -228,13 +228,12 @@
 
         def nodestate(self, node):
             rev = self.changelog.rev(node)
-            for state in STATES[::-1]:
+            for state in STATES:
                 # XXX avoid for untracked heads
                 if state.next is not None:
-                    for head in self.stateheads(state):
-                        revhead = self.changelog.rev(head)
-                        if self.changelog.descendant(revhead, rev):
-                            return state.next
+                    revs = scmutil.revrange(self, ["::%s()" % state.headssymbol])
+                    if rev in revs:
+                        break
             return state