comparison mercurial/revset.py @ 22817:e4eb4bfc3616

rangeset: use `first` and `last` instead of direct indexing This makes it compatible with all smarsets classes.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 06 Oct 2014 23:45:07 -0700
parents 5a96df266b2b
children 0e8bb81b58b9
comparison
equal deleted inserted replaced
22816:20d998395ee7 22817:e4eb4bfc3616
269 m = getset(repo, cl, x) 269 m = getset(repo, cl, x)
270 n = getset(repo, cl, y) 270 n = getset(repo, cl, y)
271 271
272 if not m or not n: 272 if not m or not n:
273 return baseset() 273 return baseset()
274 m, n = m[0], n[-1] 274 m, n = m.first(), n.last()
275 275
276 if m < n: 276 if m < n:
277 r = spanset(repo, m, n + 1) 277 r = spanset(repo, m, n + 1)
278 else: 278 else:
279 r = spanset(repo, m, n - 1) 279 r = spanset(repo, m, n - 1)