# HG changeset patch # User Anton Shestakov # Date 1548518298 -28800 # Node ID 75276f858444588d4d616877bc17cd6d0bdd472d # Parent acfd2b1a617689b62f9a6eb358a9e62a3f454c16 revset: subscriptrelations functions now have two bounds diff -r acfd2b1a6176 -r 75276f858444 hgext3rd/topic/revset.py --- a/hgext3rd/topic/revset.py Wed Jan 23 15:49:44 2019 -0500 +++ b/hgext3rd/topic/revset.py Sat Jan 26 23:58:18 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, n, order): + def stackrel(repo, subset, x, rel, n, *args): """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,6 +116,9 @@ (e.g. when stack index is too high), this returns empty set to be more revset-friendly. """ + # hg 5.0 provides two bounds, for now we support only one + if len(args) == 2 and args[0] != n: + raise NotImplementedError s = revset.getset(repo, revset.fullreposet(repo), x) if not s: return revset.baseset() @@ -143,7 +146,10 @@ revset.subscriptrelations['stack'] = stackrel revset.subscriptrelations['s'] = stackrel - def topicrel(repo, subset, x, rel, n, order): + def topicrel(repo, subset, x, rel, n, *args): + # hg 5.0 provides two bounds, for now we support only one + if len(args) == 2 and args[0] != n: + raise NotImplementedError ancestors = revset._ancestors descendants = revset._descendants subset = topicset(repo, subset, x)