如何使用“hg log”列出一系列修订?
我尝试使用 hg log
命令来显示一系列修订,从 x 到 y。
当我这样做时:
hg log -r 1+5
我得到了这样的信息:
changeset: 1:7320d2a9baa5
user: Tim Post <[email protected]>
date: Fri Sep 30 20:38:29 2011 +0800
summary: Foo foo everywhere is foo
changeset: 5:8d6bea76ce60
user: Tim Post <[email protected]>
date: Fri Sep 30 20:51:42 2011 +0800
summary: Blah blah blah
这是 Mercurial 的理解,我希望看到修订版一和五,而不是一到五。
奇怪的是,这有效:
hg log -r 1+2+3+4+5
但是,这变得非常麻烦,特别是当试图获取彼此相差 500 的修订之间的摘要时。
有没有办法获取修订版 x
到 y
而不是 x
和 y
而不串联该系列中的每个修订版?
我使用输出来确定每个开发人员在给定系列中做出的承诺数量。如果我根本无法使用 hg
命令来做到这一点,那么我非常愿意使用 Mercurial API。我求助于 hg 命令,因为我没有看到通过 API 执行此操作的明显方法。
我所说的 API 是指通过挂钩或扩展使用 Python。
I'm attempting to use the hg log
command to show a series of revisions, x through y.
When I do this:
hg log -r 1+5
I get this:
changeset: 1:7320d2a9baa5
user: Tim Post <[email protected]>
date: Fri Sep 30 20:38:29 2011 +0800
summary: Foo foo everywhere is foo
changeset: 5:8d6bea76ce60
user: Tim Post <[email protected]>
date: Fri Sep 30 20:51:42 2011 +0800
summary: Blah blah blah
Which is Mercurial understanding that I want to see revisions one and five instead of one through five.
Oddly enough, this works:
hg log -r 1+2+3+4+5
But, that gets extremely cumbersome, especially when trying to get a summary between revisions that are +500 away from each other.
Is there a way to get logs for revisions x
through y
instead of x
and y
without concatenating every revision in the series?
I'm using the output in order to determine how many commitments each developer made in a given series. If I simply can't do that using the hg
command, I'm more than open to using the Mercurial API. I resorted to the hg
command because I did not see an obvious way of doing it via the API.
By API, I mean just using Python via a hook or extension.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
hg log -r1:5
。Mercurial 有一个完整的迷你语言,专门用于选择命令的修订(不仅仅是日志)。 有关详细信息,请参阅
hg 帮助转速集
(需要 Mercurial 1.6+)。hg log -r1:5
.Mercurial has an entire mini-language devoted to selecting revisions for commands (not just for logs). For more information, see
hg help revsets
(needs Mercurial 1.6+).