src/topic/revset.py
changeset 1870 8dd5200b4086
parent 1865 558dd43b599d
--- a/src/topic/revset.py	Thu Oct 08 21:09:47 2015 -0700
+++ b/src/topic/revset.py	Wed Oct 21 01:12:32 2015 +0200
@@ -1,7 +1,7 @@
 from mercurial import revset
 from mercurial import util
 
-from . import constants
+from . import constants, destination
 
 try:
     mkmatcher = revset._stringmatcher
@@ -31,5 +31,20 @@
     return drafts.filter(
         lambda r: matcher(repo[r].extra().get(constants.extrakey, '')))
 
+def ngtipset(repo, subset, x):
+    """`ngtip([branch])`
+
+    The untopiced tip.
+
+    Name is horrible so that people change it.
+    """
+    args = revset.getargs(x, 1, 1, 'topic takes one')
+    # match a specific topic
+    branch = revset.getstring(args[0], 'ngtip() argument must be a string')
+    if branch == '.':
+        branch = repo['.'].branch()
+    return subset & destination.ngtip(repo, branch)
+
 def modsetup():
     revset.symbols.update({'topic': topicset})
+    revset.symbols.update({'ngtip': ngtipset})