1

当我们这样做时,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

有没有办法以更易读的方式输出文件?就像是:

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 
4

3 回答 3

2

--template您可以通过选项指定自己的模板。见hg help templates。你可以试试例如

hg log --template "(...) files:\n{files|stringify|fill76}\n"
于 2011-05-24T20:19:54.970 回答
1

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

于 2011-05-26T02:47:54.413 回答
0

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

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

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

于 2014-12-15T14:17:16.323 回答