Get Individual Files from {files} Template Keyword

7 views
Skip to first unread message

Jensen, Aaron

unread,
Aug 24, 2012, 1:12:10 PM8/24/12
to merc...@selenic.com

Is it possible to somehow get the individual files from the {files} template keyword? By default, {files} separates each file with a space.  We have a bunch of files in our repository with spaces in their names/paths, so when I can’t split that {files} list on the space character.  Is there a way to separate each file with a different character?

 

     <:> Aaron

 

Matt Mackall

unread,
Aug 24, 2012, 2:03:50 PM8/24/12
to Jensen, Aaron, merc...@selenic.com
Grep for "listing files on multiple lines":

http://hgbook.red-bean.com/read/customizing-the-output-of-mercurial.html

--
Mathematics is the supreme nostalgia of our time.


_______________________________________________
Mercurial mailing list
Merc...@selenic.com
http://selenic.com/mailman/listinfo/mercurial

Jensen, Aaron

unread,
Aug 24, 2012, 2:49:10 PM8/24/12
to Matt Mackall, merc...@selenic.com
Awesome. Thank you.

Is there anyway to do it without creating my own style?

I tried this:

hg log --template "changeset = \"{files}\\n\"\nfile = \"{file}\\n\""

But that didn't work. Can I only specify the format for {file} in a custom style?

<:> Aaron

Matt Mackall

unread,
Aug 24, 2012, 3:27:03 PM8/24/12
to Jensen, Aaron, merc...@selenic.com
On Fri, 2012-08-24 at 14:49 -0400, Jensen, Aaron wrote:
> Awesome. Thank you.
>
> Is there anyway to do it without creating my own style?
>
> I tried this:
>
> hg log --template "changeset = \"{files}\\n\"\nfile = \"{file}\\n\""
>
> But that didn't work. Can I only specify the format for {file} in a custom style?

Not currently. You can make compound expressions like

{files % "{file}\n"}

in the web templater, but the command-line templater grew some cruft
that prevents it.
Reply all
Reply to author
Forward
0 new messages