# HG changeset patch # User Matt Mackall # Date 1433971940 18000 # Node ID 9a81657deec2d77ba3781b881a660955cb04562e # Parent 9fa5b8f4e98ec55eeb93aca322e9e2c68b033501 summary: add topic summary hook diff -r 9fa5b8f4e98e -r 9a81657deec2 src/topic/__init__.py --- a/src/topic/__init__.py Wed Jun 10 16:23:56 2015 -0500 +++ b/src/topic/__init__.py Wed Jun 10 16:32:20 2015 -0500 @@ -12,6 +12,7 @@ """ import functools +from mercurial.i18n import _ from mercurial import cmdutil from mercurial import commands from mercurial import context @@ -120,6 +121,12 @@ marker = '*' if t == current else ' ' ui.write(' %s %s\n' % (marker, t)) +def summaryhook(ui, repo): + t = repo.currenttopic + if not t: + return + # i18n: column positioning for "hg summary" + ui.write(_("topic: %s\n") % t) def updatewrap(orig, ui, repo, *args, **kwargs): ret = orig(ui, repo, *args, **kwargs) @@ -136,3 +143,4 @@ extensions.wrapcommand(commands.table, 'update', updatewrap) topicrevset.modsetup() +cmdutil.summaryhooks.add('topic', summaryhook)