如何使用"hg log"列出一系列修订?

Tim*_*ost 18 mercurial mercurial-api

我正在尝试使用该hg log命令来显示一系列修订,xy.

当我这样做:

hg log -r 1+5
Run Code Online (Sandbox Code Playgroud)

我明白了:

changeset:   1:7320d2a9baa5
user:        Tim Post <tpost@whereiwork.com>
date:        Fri Sep 30 20:38:29 2011 +0800
summary:     Foo foo everywhere is foo

changeset:   5:8d6bea76ce60
user:        Tim Post <tpost@whereiwork.com>
date:        Fri Sep 30 20:51:42 2011 +0800
summary:     Blah blah blah
Run Code Online (Sandbox Code Playgroud)

这是Mercurial的理解,我希望看到修订版本1 5而不是1 5版本.

奇怪的是,这有效:

hg log -r 1+2+3+4+5
Run Code Online (Sandbox Code Playgroud)

但是,这非常麻烦,特别是在试图获得彼此相距+500的修订版之间的摘要时.

有没有办法x 通过 y代替x y不连接系列中的每个修订来获取修订日志?

我正在使用输出来确定每个开发人员在给定系列中做出的承诺数量.如果我根本无法使用该hg命令执行此操作,那么我非常愿意使用Mercurial API.我使用了hg命令,因为我没有通过API看到明显的方法.

通过API,我的意思是通过钩子或扩展来使用Python.

sha*_*tor 24

hg log -r1:5.

Mercurial有一个完整的迷你语言专门用于选择命令的修订(不仅仅是日志).有关更多信息,请参阅hg help revsets(需要Mercurial 1.6+).