更改 hg log -v 的格式

发布于 2024-11-09 15:43:34 字数 1167 浏览 2 评论 0原文

当我们执行 hg log -v 时,我们会看到:

changeset:   2639:283fb2da345f
parent:      2638:e06cb712d37b
parent:      2631:d8f619046812
user:        [email protected]
date:        Wed Apr 13 12:29:57 2011 -0400
files:       core/src/main/java/com/blah/boards/InvalidRateException.java core/src/main/java/com/blah/boards/InvalidException.java core/src/main/java/com/blah/area/xxx/instructions/AssignInstruction.java core/src/main/java/com/blah/area/xxx/instructions/AutoAssignInstruction.java core/src/main/java/com/blah/area/xxx/instructions/AutoDeliveryInstruction.java 
description:
Commiting after merge

有没有办法以更易读的方式输出文件?像这样的东西:

files:       
core/src/main/java/com/blah/boards/InvalidRateException.java 
core/src/main/java/com/blah/boards/InvalidException.java 
core/src/main/java/com/blah/area/xxx/instructions/AssignInstruction.java 
core/src/main/java/com/blah/area/xxx/instructions/AutoAssignInstruction.java 
core/src/main/java/com/blah/area/xxx/instructions/AutoDeliveryInstruction.java 

When we do hg log -v we see:

changeset:   2639:283fb2da345f
parent:      2638:e06cb712d37b
parent:      2631:d8f619046812
user:        [email protected]
date:        Wed Apr 13 12:29:57 2011 -0400
files:       core/src/main/java/com/blah/boards/InvalidRateException.java core/src/main/java/com/blah/boards/InvalidException.java core/src/main/java/com/blah/area/xxx/instructions/AssignInstruction.java core/src/main/java/com/blah/area/xxx/instructions/AutoAssignInstruction.java core/src/main/java/com/blah/area/xxx/instructions/AutoDeliveryInstruction.java 
description:
Commiting after merge

Is there a way to output the file in a more readable manner? Something like:

files:       
core/src/main/java/com/blah/boards/InvalidRateException.java 
core/src/main/java/com/blah/boards/InvalidException.java 
core/src/main/java/com/blah/area/xxx/instructions/AssignInstruction.java 
core/src/main/java/com/blah/area/xxx/instructions/AutoAssignInstruction.java 
core/src/main/java/com/blah/area/xxx/instructions/AutoDeliveryInstruction.java 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

美胚控场 2024-11-16 15:43:34

您可以通过 --template 选项指定您自己的模板。请参阅hg 帮助模板。你可以尝试例如

hg log --template "(...) files:\n{files|stringify|fill76}\n"

You can specify your own template via --template option. See hg help templates. You could try e.g.

hg log --template "(...) files:\n{files|stringify|fill76}\n"
好久不见√ 2024-11-16 15:43:34

如果您只需要单个修订版的文件列表,您可以使用 hg status --change 2639 来显示带有 M、A、R、D 前缀的文件列表,您可以通过添加--no-status 标志。

If you want just the files list for a single revision you can use hg status --change 2639 which shows the file list prefixed with M, A, R, D prefixed, which you can omit by adding the --no-status flag.

平安喜乐 2024-11-16 15:43:34

这个问题很老了,但无论如何,这里有一个解决方案:

hg log -v  --template "{files % '{file}\n'}"

值得检查一下: http://www.selenic.com/mercurial/hg.1.html#template-usage

This question is quite old, but anyway, here goes a solution:

hg log -v  --template "{files % '{file}\n'}"

Worth checking this: http://www.selenic.com/mercurial/hg.1.html#template-usage

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文