Mercurial > evolve
changeset 4369:75276f858444
revset: subscriptrelations functions now have two bounds
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Sat, 26 Jan 2019 23:58:18 +0800 |
parents | acfd2b1a6176 |
children | 45c0415e45b9 |
files | hgext3rd/topic/revset.py |
diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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)