diff -r 995617c7f2fc -r 8dd5200b4086 src/topic/destination.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/topic/destination.py Wed Oct 21 01:12:32 2015 +0200 @@ -0,0 +1,19 @@ +from mercurial import revset +from mercurial import error +def ngtip(repo, branch, all=False): + """tip new generation""" + ## search for untopiced heads of branch + # could be heads((::branch(x) - topic())) + # but that is expensive + # + # we should write plain code instead + subquery = '''heads( + parents( + ancestor( + (head() and branch(%s) + or (topic() and branch(%s))))) + ::(head() and branch(%s)) + - topic())''' + if not all: + subquery = 'max(%s)' % subquery + return repo.revs(subquery, branch, branch, branch)