2010-08-02 96 views

回答

24

Mercurial 2.3及以上,使用

hg log -G 

对于年龄较大的水银,需要先安装的graphlog extension这将使上面的命令。 graphlog扩展还在所有版本的Mercurial中添加了别名

hg glog 

+1

一些真棒别名然后,你可以只输入'汞glog'得到相似的输出。 – Santa 2010-08-02 18:18:50

+0

你如何得到颜色? – AJP 2013-06-04 09:47:48

5

您可以在hg中创建自定义模板和别名。例如,在你的.hgrc创建别名如下:

[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 

hg lg -G

输出会是这样调用它。

enter image description here

霍尔迪在他blog

+0

任何想法如何让它看起来像一个图?它总是显示当前分支的单个时间线。我试着按照Jordis博客上的指示,它不起作用 – danfromisrael 2017-08-14 06:45:43

+0

@danfromisrael如果感兴趣,看看我的.hgrc在这里https://bitbucket.org/carun/dot-files/raw/tip/.hgrc – Arun 2017-08-14 23:30:17

+0

不知道是否我理解你的问题。这是一个Kallithea回购的图表:http://i.imgur.com/sYieqUF.png我的'〜/ .hgrc'别名有'lg = log --template'{label('custom.rev',rev)} \ t {label('custom.node',node | short)} {label('custom.phase',phase)} \ t {label('custom.age',date | age)} \ t {desc | firstline } {label('custom.user',author | user)} {label('custom.branch',branch)} {label('custom.tag',tags)} {label('custom.book',书签) } \ n“-G'我也有'[实验] graphshorten = true' – Arun 2017-08-14 23:37:50