Commit cc9b6e64 authored by Anton Shestakov's avatar Anton Shestakov
Browse files

stack: rename stack.revs into stack.indexedrevs

They are accessible by an index, and are sorted. But they don't include all
revisions for show in showstack().
parent 13ca3810a105
Pipeline #482 passed with stage
in 12 minutes and 13 seconds
......@@ -132,7 +132,7 @@
def getrange(st, a, b):
start = 1 if a is None else a
end = len(st.revs) if b is None else b + 1
end = len(st.indexedrevs) if b is None else b + 1
return range(start, end)
revs = []
......@@ -143,7 +143,7 @@
else:
st = stack.stack(repo, branch=repo[r].branch())
for n in getrange(st, a, b):
if abs(n) >= len(st.revs):
if abs(n) >= len(st.indexedrevs):
# also means stack base is not accessible with n < 0, which
# is by design
continue
......@@ -151,7 +151,7 @@
# quirk: we don't want stack base unless specifically asked
# for it (at least one of the indices is 0)
continue
rev = st.revs[n]
rev = st.indexedrevs[n]
if rev == -1 and n == 0:
continue
if rev not in revs:
......
......@@ -73,6 +73,6 @@
self._revs = trevs
def __iter__(self):
return iter(self.revs)
return iter(self.indexedrevs)
def __getitem__(self, index):
......@@ -77,6 +77,6 @@
def __getitem__(self, index):
return self.revs[index]
return self.indexedrevs[index]
def __nonzero__(self):
return bool(self._revs)
......@@ -84,7 +84,7 @@
__bool__ = __nonzero__
def index(self, item):
return self.revs.index(item)
return self.indexedrevs.index(item)
@util.propertycache
def _dependencies(self):
......@@ -138,7 +138,7 @@
return deps, rdeps
@util.propertycache
def revs(self):
def indexedrevs(self):
# some duplication/change from _orderrevs because we use a post
# processed dependency graph.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment