diff -r 88887b2be07c -r 312b9e8a4c9c hgext3rd/topic/revset.py --- a/hgext3rd/topic/revset.py Sun Feb 03 12:04:50 2019 +0100 +++ b/hgext3rd/topic/revset.py Wed Feb 06 13:49:29 2019 +0800 @@ -108,7 +108,7 @@ return revset.baseset(stack.stack(repo, branch=branch, topic=topic)[1:]) & subset if util.safehasattr(revset, 'subscriptrelations'): - def stackrel(repo, subset, x, rel, a, *args): + def stackrel(repo, subset, x, rel, z, order): """This is a revset-flavored implementation of stack aliases. The syntax is: rev#stack[n] or rev#s[n]. Plenty of logic is borrowed @@ -116,11 +116,15 @@ (e.g. when stack index is too high), this returns empty set to be more revset-friendly. """ - # hg 4.9 provides one bound, hg 5.0 provides two - if len(args) == 2: - b = args[0] + # hg 4.9 provides a number or None, hg 5.0 provides a tuple of tokens + if isinstance(z, tuple): + a, b = revset.getintrange( + z, + 'relation subscript must be an integer or a range', + 'relation subscript bounds must be integers', + None, None) else: - b = a + a = b = z s = revset.getset(repo, revset.fullreposet(repo), x) if not s: