Search code examples
mercurialcommand

Mercurial log with one-liners


The regular hg log command gives output with at least 4 lines per changeset. For example

changeset:   238:03a214f2a1cf
user:        My Name <my.name@example.com>
date:        Thu Aug 26 09:49:32 2010 +0200
summary:     Added tag v1.1 for changeset f22fd3974361

I mean to remember that there was a command to print a log in a more compact way what just had one line per changeset. A format that you could basically stick in a changelog.txt file and it would look nice.

Does that exist? Or am I mixing this with something I have seen with git or something else?


Solution

  •  hg log --style compact
    

    You can also use templates to display log out in different formats

    hg help templates
    

    In your case if you want to display only node ids do something like this

    hg log --template "{node}\n"