comparison mercurial/cmdutil.py @ 31703:9b3577796291

cmdutil: add a "changeset.obsolete" label in changeset_printer Until now there were no label to highlight obsolete changesets in log output, only evolution troubles (unstable, bumped, divergent) are supported. We add a "changeset.obsolete" label on changeset entries produced by changeset_printer so that obsolete changesets can be highlighted in log output. This is useful because, unless using a graph log where obsolete changesets have a 'x' marker, there's no way to identify obsolete changesets. And even in graph mode, when working directory's parent is obsolete, we get a '@' marker and we do not see it as obsolete.
author Denis Laxalde <denis@laxalde.org>
date Sat, 25 Mar 2017 09:39:07 +0100
parents 06d3c40fc3e7
children e6eb86b154c5
comparison
equal deleted inserted replaced
31702:992882cef7e1 31703:9b3577796291
1153 sub.diff(ui, diffopts, tempnode2, submatch, changes=changes, 1153 sub.diff(ui, diffopts, tempnode2, submatch, changes=changes,
1154 stat=stat, fp=fp, prefix=prefix) 1154 stat=stat, fp=fp, prefix=prefix)
1155 1155
1156 def _changesetlabels(ctx): 1156 def _changesetlabels(ctx):
1157 labels = ['log.changeset', 'changeset.%s' % ctx.phasestr()] 1157 labels = ['log.changeset', 'changeset.%s' % ctx.phasestr()]
1158 if ctx.obsolete():
1159 labels.append('changeset.obsolete')
1158 if ctx.troubled(): 1160 if ctx.troubled():
1159 labels.append('changeset.troubled') 1161 labels.append('changeset.troubled')
1160 for trouble in ctx.troubles(): 1162 for trouble in ctx.troubles():
1161 labels.append('trouble.%s' % trouble) 1163 labels.append('trouble.%s' % trouble)
1162 return ' '.join(labels) 1164 return ' '.join(labels)