如何使用“hg log"列出一系列修订? [英] How can I list a series of revisions using 'hg log'?

查看:27
本文介绍了如何使用“hg log"列出一系列修订?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm attempting to use the hg log command to show a series of revisions, x through y.

当我这样做时:

hg log -r 1+5

我明白了:

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

Mercurial 理解我希望看到修订版一五,而不是一五.

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

但是,这会变得极其麻烦,尤其是当试图在彼此相差 +500 的修订之间获取摘要时.

But, that gets extremely cumbersome, especially when trying to get a summary between revisions that are +500 away from each other.

有没有办法获取x通过y而不是x y 没有连接系列中的每个修订版?

Is there a way to get logs for revisions x through y instead of x and y without concatenating every revision in the series?

我使用输出是为了确定每个开发人员在给定系列中做出的承诺数量.如果我不能使用 hg 命令来做到这一点,我非常愿意使用 Mercurial API.我求助于 hg 命令,因为我没有看到通过 API 执行此操作的明显方法.

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.

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

By API, I mean just using Python via a hook or extension.

推荐答案

hg log -r1:5.

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

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

这篇关于如何使用“hg log"列出一系列修订?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆