src/topic/stack.py
changeset 1895 c8e4c6e03957
child 1896 4ae421cbb07c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/topic/stack.py	Mon Mar 14 17:37:39 2016 +0000
@@ -0,0 +1,20 @@
+# stack.py - code related to stack workflow
+#
+# This software may be used and distributed according to the terms of the
+# GNU General Public License version 2 or any later version.
+from mercurial.i18n import _
+from mercurial import error
+
+def _getstack(repo, topic):
+    # XXX need to exclude obsolete changesets
+    # XXX need sorting
+    return repo.revs("topic(%s)", topic)
+
+def showstack(ui, repo, topic):
+    if not topic:
+        topic = repo.currenttopic
+    if not topic:
+        raise error.Abort(_('no active topic to list'))
+    for r in _getstack(repo, topic):
+        # super crude initial version
+        ui.write(repo[r].description().splitlines()[0] + '\n')