hgext3rd/topic/stack.py
changeset 2668 1d2c66dc4ee3
parent 2632 62eb5a2d2112
child 2669 b933a8068c17
--- a/hgext3rd/topic/stack.py	Tue Jun 27 15:21:38 2017 +0200
+++ b/hgext3rd/topic/stack.py	Wed Jun 28 01:58:09 2017 +0200
@@ -10,7 +10,7 @@
 )
 from .evolvebits import builddependencies, _orderrevs, _singlesuccessor
 
-def getstack(repo, topic):
+def getstack(repo, topic=None):
     # XXX need sorting
     trevs = repo.revs("topic(%s) - obsolete()", topic)
     return _orderrevs(repo, trevs)
@@ -21,7 +21,9 @@
     """
     return ' '.join(prefix % suffix for suffix in labelssuffix)
 
-def showstack(ui, repo, topic, opts):
+def showstack(ui, repo, topic=None, opts=None):
+    if opts is None:
+        opts = {}
 
     if topic not in repo.topics:
         raise error.Abort(_('cannot resolve "%s": no such topic found') % topic)
@@ -35,7 +37,7 @@
     if topic == repo.currenttopic:
         label = 'topic.active'
 
-    data = stackdata(repo, topic)
+    data = stackdata(repo, topic=topic)
     fm.plain(_('### topic: %s') % ui.label(topic, label),
              label='topic.stack.summary.topic')
 
@@ -56,7 +58,7 @@
         fm.plain('%d behind' % data['behindcount'], label='topic.stack.summary.behindcount')
     fm.plain('\n')
 
-    for idx, r in enumerate(getstack(repo, topic), 1):
+    for idx, r in enumerate(getstack(repo, topic=topic), 1):
         ctx = repo[r]
         p1 = ctx.p1()
         if p1.obsolete():
@@ -111,7 +113,7 @@
         fm.plain('\n')
     fm.end()
 
-def stackdata(repo, topic):
+def stackdata(repo, topic=None):
     """get various data about a stack
 
     :changesetcount: number of non-obsolete changesets in the stack