Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pretty hg branch graphs

With hg, how I can see in command line the branches graphs? Similar to

git log --pretty=oneline --graph
like image 427
JuanPablo Avatar asked Aug 02 '10 03:08

JuanPablo


2 Answers

For Mercurial 2.3 and up, use

hg log -G

For older Mercurial, you need to first install the the graphlog extension which will enable the above command. The graphlog extension also adds an alias

hg glog

in all versions of Mercurial.

like image 81
Roger Wang Avatar answered Nov 17 '22 06:11

Roger Wang


You can create custom templates and aliases in hg. For instance, create an alias in your .hgrc as follows:

[alias]
lg = log --template "{label('custom.rev', rev)}\t{label('custom.phase',phase)}\t{label('custom.tag',tags)}\t{desc|firstline} {label('custom.age', date|age)} {label('custom.user', author|user)}\n"

[color]
custom.rev = yellow
custom.phase = bold
custom.user = cyan
custom.age = bold
custom.tag = bold yellow

and invoke it with

hg lg -G

The output will be like this.

enter image description here

Jordi has some awesome aliases in his blog

like image 33
Arun Avatar answered Nov 17 '22 07:11

Arun