mercurial/templatekw.py
changeset 37707 24fee31fda05
parent 37686 b1b1b0626f59
child 37908 8808d5d401ee
--- 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):