# HG changeset patch # User Pierre-Yves David # Date 2014-10-08 07:55:09 # Node ID e74245b79901a7efc0d1cfd95f2e3939eab97030 # Parent 5385314e0b146fbb457a1b10b01eaf6e533115eb revset-last: remove user of baseset.append A `baseset` has multiple cached results and will get even more in the future. Making it an object "populated once" like the other smartsets makes it both safer and simpler. The append method will be removed at some point. diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -1043,16 +1043,16 @@ def last(repo, subset, x): ss = subset.set() os = getset(repo, spanset(repo), l[0]) os.reverse() - bs = baseset() + result = [] it = iter(os) for x in xrange(lim): try: y = it.next() if y in ss: - bs.append(y) + result.append(y) except (StopIteration): break - return bs + return baseset(result) def maxrev(repo, subset, x): """``max(set)``