# HG changeset patch # User Zeger Van de Vannet # Date 1748809421 -7200 # Node ID 5401fa8a11d427b7f548cb12794b4390e83cd5c0 # Parent 00f99f702ad9fe0c1ef1765c3c44ac01b956214e feat: add /stack command diff -r 00f99f702ad9 -r 5401fa8a11d4 hgext3rd/topic_web.py --- a/hgext3rd/topic_web.py Fri May 30 18:01:26 2025 +0200 +++ b/hgext3rd/topic_web.py Sun Jun 01 22:23:41 2025 +0200 @@ -4,6 +4,9 @@ from mercurial.hgweb import webcommands, webutil from mercurial import templateutil, extensions from mercurial.node import hex +from mercurial.extensions import find + +topic = find(b'topic') @webcommands.webcommand(b"topics") def topics(web): @@ -39,6 +42,23 @@ return templateutil.mappinggenerator(entries) +@webcommands.webcommand(b"stack") +def stack(web): + topic_name = web.req.qsparams[b'node'] + stack = topic.stack.stack(web.repo, topic=topic_name) + + return web.sendtemplate(b"stack", entries=stackentries(web, web.stripecount, stack)) + +webcommands.stack = stack + +def stackentries(web, stripecount, stack): + def entries(context): + for rev in stack: + yield webutil.changelistentry(web, web.repo[rev]) + + return templateutil.mappinggenerator(entries) + + def commonentry(orig, repo, ctx): data = orig(repo, ctx) data[b'topic'] = ctx.topic() diff -r 00f99f702ad9 -r 5401fa8a11d4 templates/paper-extended/map --- a/templates/paper-extended/map Fri May 30 18:01:26 2025 +0200 +++ b/templates/paper-extended/map Sun Jun 01 22:23:41 2025 +0200 @@ -207,6 +207,7 @@ ' +stack = stack.tmpl branches = branches.tmpl branchentry = ' diff -r 00f99f702ad9 -r 5401fa8a11d4 templates/paper-extended/stack.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/paper-extended/stack.tmpl Sun Jun 01 22:23:41 2025 +0200 @@ -0,0 +1,54 @@ +{header} +{repo|escape}: branches + + + + + +
+ + +
+ +

branches

+ +{searchform} + + + + + + + + + +{entries % shortlogentry} + +
branchnode
+
+
+ +{footer} +