hgext3rd/topic/stack.py
changeset 5223 cc9b6e64027c
parent 5222 13ca3810a105
equal deleted inserted replaced
5222:13ca3810a105 5223:cc9b6e64027c
    71         else:
    71         else:
    72             raise error.ProgrammingError(b'neither branch and topic specified (not defined yet)')
    72             raise error.ProgrammingError(b'neither branch and topic specified (not defined yet)')
    73         self._revs = trevs
    73         self._revs = trevs
    74 
    74 
    75     def __iter__(self):
    75     def __iter__(self):
    76         return iter(self.revs)
    76         return iter(self.indexedrevs)
    77 
    77 
    78     def __getitem__(self, index):
    78     def __getitem__(self, index):
    79         return self.revs[index]
    79         return self.indexedrevs[index]
    80 
    80 
    81     def __nonzero__(self):
    81     def __nonzero__(self):
    82         return bool(self._revs)
    82         return bool(self._revs)
    83 
    83 
    84     __bool__ = __nonzero__
    84     __bool__ = __nonzero__
    85 
    85 
    86     def index(self, item):
    86     def index(self, item):
    87         return self.revs.index(item)
    87         return self.indexedrevs.index(item)
    88 
    88 
    89     @util.propertycache
    89     @util.propertycache
    90     def _dependencies(self):
    90     def _dependencies(self):
    91         deps, rdeps = builddependencies(self._repo, self._revs)
    91         deps, rdeps = builddependencies(self._repo, self._revs)
    92 
    92 
   136                         stack.append(p)
   136                         stack.append(p)
   137 
   137 
   138         return deps, rdeps
   138         return deps, rdeps
   139 
   139 
   140     @util.propertycache
   140     @util.propertycache
   141     def revs(self):
   141     def indexedrevs(self):
   142         # some duplication/change from _orderrevs because we use a post
   142         # some duplication/change from _orderrevs because we use a post
   143         # processed dependency graph.
   143         # processed dependency graph.
   144 
   144 
   145         # Step 1: compute relation of revision with each other
   145         # Step 1: compute relation of revision with each other
   146         origdeps, rdependencies = self._dependencies
   146         origdeps, rdependencies = self._dependencies