hgext3rd/topic/revset.py
changeset 2669 b933a8068c17
parent 2668 1d2c66dc4ee3
child 2681 aa4db71a6224
--- a/hgext3rd/topic/revset.py	Wed Jun 28 01:58:09 2017 +0200
+++ b/hgext3rd/topic/revset.py	Wed Jun 28 02:45:57 2017 +0200
@@ -75,7 +75,13 @@
     if not topic:
         raise error.Abort(_('no active topic to list'))
     # ordering hack, boo
-    return revset.baseset(stack.getstack(repo, topic=topic)) & subset
+    topic = None
+    branch = None
+    if not topic and repo.currenttopic:
+        topic = repo.currenttopic
+    if not topic:
+        branch = repo[None].branch()
+    return revset.baseset(stack.getstack(repo, branch=branch, topic=topic)) & subset
 
 
 def modsetup(ui):