--- a/mercurial/templatekw.py Sun Apr 15 19:28:01 2018 +0800
+++ b/mercurial/templatekw.py Sun Apr 15 19:41:34 2018 +0800
@@ -802,7 +802,7 @@
ctx = context.resource(mapping, 'ctx')
def formatnode(ctx):
- return ' %s (%s)' % (scmutil.formatchangeid(ctx), ctx.phasestr())
+ return '%s (%s)' % (scmutil.formatchangeid(ctx), ctx.phasestr())
entries = obsutil.whyunstable(repo, ctx)
@@ -814,7 +814,8 @@
lambda x: formatnode(repo[x]))
entry['divergentnodes'] = dnhybrid
- tmpl = '{instability}:{divergentnodes} {reason} {node|short}'
+ tmpl = ('{instability}:{if(divergentnodes, " ")}{divergentnodes} '
+ '{reason} {node|short}')
return templateutil.mappinglist(entries, tmpl=tmpl, sep='\n')
def loadkeyword(ui, extname, registrarobj):