templates and the log --debug output the extra fields

Uwe Brauer oub at mat.ucm.es
Tue Jan 5 08:22:41 UTC 2021


>>> "CO" == Craig Ozancin <c.ozancin at gmail.com> writes:


   > If you want it with color:
   > etopic = '{if(topics, label('log.topic', 'extra:       topic={topics}\n'))}'

thanks, but it only works for and active topic.

I modified my template:

etopic = '{if(topics, label('log.topic', 'extra:       topic={topics}\n'))}'
changeset = "\x1B[33mchangeset:   {rev}:{node|short}\nBranch:      {branch}\n{tags}{bookmarks}Author:      {author}\nDate:        {date|rfc822date}\n{ifeq(topic,"","","\x1B[42mTopic:       {topic}\n")}Phase:       {phase}\n{etopic}\nSummary:     {desc|firstline}\n{nofiles}\n"
tag = "tag:         {tag}\n"
bookmark = "bookmark:    {bookmark}\n"

Running 

Hg log -G --debug --style /home/oub/myhgstyle

Results in 

◍  changeset:   432:cb80c31c1d90
│  Branch:      year-20-21
│  tag:         tip
│  Author:      Uwe Brauer <oub at mat.ucm.es>
│  Date:        Fri, 25 Dec 2020 09:12:30 +0100
│  Topic:       fechas-controles
│  Phase:       draft
│  extra:       topic=fechas-controles
│
│  Summary:     Also sent to Rebeca
│
○  changeset:   431:ceb486e510e0
│  Branch:      year-20-21
│  Author:      Uwe Brauer <oub at mat.ucm.es>
│  Date:        Sun, 20 Dec 2020 11:01:45 +0100
│  Phase:       public
│
│  Summary:     Add Files: Overview aulas y dates of the exams.

So change set 431 has no entry. The template has a if(topics) so this is
to be expected.

I changed it to 

etopic = '{label('log.topic', 'extra:       topic={topics}\n')}'

But then 
◍  changeset:   432:cb80c31c1d90
│  Branch:      year-20-21
│  tag:         tip
│  Author:      Uwe Brauer <oub at mat.ucm.es>
│  Date:        Fri, 25 Dec 2020 09:12:30 +0100
│  Topic:       fechas-controles
│  Phase:       draft
│  extra:       topic=fechas-controles
│
│  Summary:     Also sent to Rebeca
│
○  changeset:   431:ceb486e510e0
│  Branch:      year-20-21
│  Author:      Uwe Brauer <oub at mat.ucm.es>
│  Date:        Sun, 20 Dec 2020 11:01:45 +0100
│  Phase:       public
│  extra:       topic=
│

The point is I don't know the variable name of the extra field.




-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5673 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20210105/3dace77d/attachment.p7s>


More information about the Mercurial mailing list