Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.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 | e9555305c5c6 |
comparison
equal
deleted
inserted
replaced
45770:96fcc37a9c80 | 45771:f90a5c211251 |
---|---|
1220 if not spec: | 1220 if not spec: |
1221 spec = ui.config(b'command-templates', b'oneline-summary') | 1221 spec = ui.config(b'command-templates', b'oneline-summary') |
1222 if not spec: | 1222 if not spec: |
1223 spec = default_spec | 1223 spec = default_spec |
1224 if not spec: | 1224 if not spec: |
1225 # TODO: Pick a default we can agree on. This isn't used yet. | 1225 spec = ( |
1226 raise error.ProgrammingError(b"no default one-line summary defined yet") | 1226 b'{separate(" ", ' |
1227 b'label("log.changeset", "{rev}:{node|short}")' | |
1228 b', ' | |
1229 b'label("log.tag", tags)' | |
1230 b', ' | |
1231 b'label("log.bookmark", bookmarks)' | |
1232 b')} ' | |
1233 b'"{label("log.desc", desc|firstline)}"' | |
1234 ) | |
1227 text = rendertemplate(ctx, spec) | 1235 text = rendertemplate(ctx, spec) |
1228 return text.split(b'\n')[0] | 1236 return text.split(b'\n')[0] |
1229 | 1237 |
1230 | 1238 |
1231 def _buildfntemplate(pat, total=None, seqno=None, revwidth=None, pathname=None): | 1239 def _buildfntemplate(pat, total=None, seqno=None, revwidth=None, pathname=None): |