changeset 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
files states.py
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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