diff 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
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Thu Oct 22 23:10:06 2020 -0700
+++ b/mercurial/cmdutil.py	Tue Oct 27 15:33:15 2020 -0700
@@ -1222,8 +1222,16 @@
     if not spec:
         spec = default_spec
     if not spec:
-        # TODO: Pick a default we can agree on. This isn't used yet.
-        raise error.ProgrammingError(b"no default one-line summary defined yet")
+        spec = (
+            b'{separate(" ", '
+            b'label("log.changeset", "{rev}:{node|short}")'
+            b', '
+            b'label("log.tag", tags)'
+            b', '
+            b'label("log.bookmark", bookmarks)'
+            b')} '
+            b'"{label("log.desc", desc|firstline)}"'
+        )
     text = rendertemplate(ctx, spec)
     return text.split(b'\n')[0]