tags:

views:

365

answers:

2

hg log works.
hg log --style does not work.

C:\temp\myhg>"c:\program files\mercurial\hg" log

changeset:   0:9c62e300d833
user:        Administrator@biostar
date:        Wed Oct 21 04:57:41 2009 -0500
summary:     124 my first commit

C:\temp\myhg>"c:\program files\mercurial\hg" log --style paper
abort: Permission denied: c:\program files\mercurial\templates\paper

As long as you're reading, here's the big picture: I want to get log format in an easy-to-parse format. If I use a --template {files} with the the log command, and if there are spaces in the filenames, the output isn't friendly to parsing. So, according to the docs, I need to use a "style". But, I can't even get as far as using the styles that install with Mercurial.

I did a vanilla install of Mercurial on Windows XP and have been able to run the init, add, commit, and log commands with no problems.

+1  A: 

For me, hg help templating says:

Three styles are packaged with Mercurial: default (the style used when no explicit preference is passed), compact and changelog.

Perhaps something needs to be done to enable the paper style? I'm not sure.

Doug McClean
Nope, there's no `paper` style, it's a theme for the web interface :-)
Martin Geisler
Cool, thanks Martin. :) (I was just taking a WAG.)
Doug McClean
+4  A: 

AFAIK, html template sets like 'paper' are designed for being used from hgweb. I don't know how to use them from command line.

What you can do: write a style that would be easy to parse.

To use a style you need to have a file named map-cmdline.<style> in templates subdirectory of your Hg installation. Here is the sample of creating template for custom log report. Here is a chapter on styles from HgBook.

Hope this will help you.

elder_george
With Doug's hint, I happened to figure out the map-cmdline part before reading your answer. The chapter on styles in the HgBook doesn't even mention the "map-cmdline" part. If you start with the "From templates to styles" part, you would think you could just create a file with any name, any location....
Corey Trager