问题描述
|
当我们做
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
解决方法
您可以通过
--template
选项指定自己的模板。参见hg help templates
。您可以尝试例如
hg log --template \"(...) files:\\n{files|stringify|fill76}\\n\"
,如果只需要单个修订的文件列表,则可以使用ѭ6来显示以M,A,R,D为前缀的文件列表,可以通过添加--no-status
标志来省略。
,这个问题已经很老了,但是无论如何,这里有一个解决方案:
hg log -v --template \"{files % \'{file}\\n\'}\"
值得检查一下:http://www.selenic.com/mercurial/hg.1.html#template-usage