Mercurial > hg
comparison hgext/rebase.py @ 45771:f90a5c211251
rebase: change and standarize template for rebase's one-line summary
This removes the default template in rebase and switches to a
centrally defined template. I've simplified it a bit to avoid the
conditional parenthesis. I've also added labels so the different parts
can be easily colored. The template is somewhat similar to what we've
used internally at Google for a few years.
I'm happy to change the template if others have opinions. Should we
reuse the `color.log.` names as I have?
Differential Revision: https://phab.mercurial-scm.org/D9252
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 27 Oct 2020 15:33:15 -0700 |
parents | 96fcc37a9c80 |
children | 1703a7f9d5b8 |
comparison
equal
deleted
inserted
replaced
45770:96fcc37a9c80 | 45771:f90a5c211251 |
---|---|
144 return smartset.baseset(dests) | 144 return smartset.baseset(dests) |
145 | 145 |
146 | 146 |
147 def _ctxdesc(ctx): | 147 def _ctxdesc(ctx): |
148 """short description for a context""" | 148 """short description for a context""" |
149 labels_spec = b'join(filter(namespaces % "{ifeq(namespace, "branches", "", join(names, " "))}"), " ")' | |
150 spec = b'{rev}:{node|short} "{desc|firstline}"{if(%s, " ({%s})")}' % ( | |
151 labels_spec, | |
152 labels_spec, | |
153 ) | |
154 return cmdutil.format_changeset_summary( | 149 return cmdutil.format_changeset_summary( |
155 ctx.repo().ui, ctx, command=b'rebase', default_spec=spec | 150 ctx.repo().ui, ctx, command=b'rebase' |
156 ) | 151 ) |
157 | 152 |
158 | 153 |
159 class rebaseruntime(object): | 154 class rebaseruntime(object): |
160 """This class is a container for rebase runtime state""" | 155 """This class is a container for rebase runtime state""" |