log log -G should show the branch
Cameron Simpson
cs at cskk.id.au
Mon Oct 21 03:20:43 UTC 2019
On 20Oct2019 17:15, Uwe Brauer <oub at mat.ucm.es> wrote:
> hg log -G
>Shows the graph, (and the bookmarks)
>
>For example
>@ changeset: 231:861bf36742b0
>| bookmark: hg_named_branch/default
>| tag: tip
>| user: Uwe Brauer <oub at mat.ucm.es>
>| date: Sun Oct 20 16:56:54 2019 +0300
>| summary: breqn package removed because of problems with mathbullet
>
>But not the branch. So I tried to cook something up like
>
> log -G --template "\x1B[33mcommit {rev}:{node|short}\nBranch: {branch}\nBookmark: {bookmarks}\nAuthor: {author}\nDate: {date|rfc822date}\nPhase: {phase}\nSummary: {desc}\n{nofiles}\n"
>
>@ commit 231:861bf36742b0
>| Branch: default
>| Bookmark: hg_named_branch/default
>| Author: Uwe Brauer <oub at mat.ucm.es>
>| Date: Sun, 20 Oct 2019 16:56:54 +0300
>| Phase: draft
>| Summary: breqn package removed because of problems with mathbullet
[...]
>That shows the branch, but also *always* the bookmark field, although
>the bookmark field should only be shown if it is not empty.
Hmm. I like my log to look like this:
o cs at cskk.id.au cs.deco: @contextual: add a doctest
| 2019-10-12 15:27 +1100 20532:f7f2739434df<-d2696c9ab09d
|
o cs at cskk.id.au cs.deco: new @contextual decorator to turn a simple function into a context manager; @strable: mention context manager requirement and @contextual as workaround
| 2019-10-12 11:51 +1100 20531:d2696c9ab09d<-80c847ea3851
|
o cs at cskk.id.au merge later ==> default: split output pipeline code from cs.alet, publish as cs.pipeline
|\ 2019-10-08 09:33 +1100 20530:80c847ea3851<-20502:711c7c7d7a29 20529:787bce45cd8d
| |
| o cs at cskk.id.au cs.app.pilfer: simplify test
| | 2019-10-08 09:32 +1100 20529:787bce45cd8d<-ac5a75cf61f3 [later]
| |
| o cs at cskk.id.au cs.app.pilfer: clean lint, drop python 2 support; more to do still
| | 2019-10-07 16:46 +1100 20528:ac5a75cf61f3<-e2a7a780690e [later]
which is done with this template string:
'{author|email} {desc|firstline}\n{date|isodate} {rev}:{node|short}<-{ifeq(p2node|short,"000000000000",p1node|short,join(parents))}{ifeq(branch,"default",""," [{branch}]")}{ifeq(activebookmark,"","","@{activebookmark}")}{ifeq(count(tags),0,""," ({join(tags)})")}\n\n'
Have a look at the {ifeq(...)} stuff, it should let you do what you
want. For example, the above writes this:
| 2019-10-20 20:54 +1100 1487:339f747c8851<-44771848ccdb [dev]@development (tip)
for a commit with a branch and a bookmark.
Cheers,
Cameron Simpson <cs at cskk.id.au>
More information about the Mercurial
mailing list