简体   繁体   English

更改 hg log -v 的格式

[英]Change format of hg log -v

When we do hg log -v we see:当我们执行hg log -v时,我们看到:

changeset:   2639:283fb2da345f
parent:      2638:e06cb712d37b
parent:      2631:d8f619046812
user:        joe@pub.com
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?有没有办法以更易读的方式 output 文件? 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 

You can specify your own template via --template option.您可以通过--template选项指定自己的模板。 See hg help templates .请参阅hg help templates You could try eg你可以试试例如

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

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.如果您只想要单个修订的文件列表,您可以使用hg status --change 2639显示以 M、A、R、D 为前缀的文件列表,您可以通过添加--no-status标志来省略它。

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值得检查: http://www.selenic.com/mercurial/hg.1.html#template-usage

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM