Change format of hg log -v

369 Views Asked by At

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 
3

There are 3 best solutions below

0
On

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

0
On

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.

0
On

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"