How can I list a series of revisions using 'hg log'?

孤街浪徒 提交于 2020-12-02 03:40:59

问题


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 <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

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.


回答1:


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+).



来源:https://stackoverflow.com/questions/7791903/how-can-i-list-a-series-of-revisions-using-hg-log

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!