using template to distinguish between files and files with spaces

Jens Alfke jens at mooseyard.com
Sun Mar 16 16:47:58 CDT 2008


On 16 Mar '08, at 1:23 PM, Brian Harris wrote:

> How can I issue an 'hg incoming' which correctly distinguishes  
> between multiple files and a single file with spaces.

Your style needs to define 'file' as something that has delimiters  
around it. For example, a line from a style that I use that outputs XML:

file     = '\t<file path="{file|escape}" />\n'

(I don't know if you can do this just using --template. I actually  
have a style file that I point hg at using a --style argument.)

—Jens

#### PS: Here's my file "xml.style":

header = '<?xml version="1.0" encoding="UTF-8" ?>\n<repository  
name="{repo}">\n\n'
footer = '</repository>\n'
changeset = changeset.tmpl
file     = '\t<file path="{file|escape}" />\n'
file_add = '\t<file path="{file_add|escape}" mode="add" />\n'
file_del = '\t<file path="{file_del|escape}" mode="del" />\n'
file_copy= '\t<file path="{file_copy|escape}" mode="copy"  
src="{source}" />\n'
parent = '    <parent rev="{rev}" />\n'
branch = '    <branch name="{branch|escape}" />\n'
tag    = '    <tag name="{tag|escape}" />\n'
extra  = '    <extra key="{key|escape}" value="{value|escape}" />\n'

#### Here's "changeset.tmpl":

<changeset rev="{rev}" node="{node|escape}" date="{date|hgdate|escape}">
{parents}{branches}{tags}
     <author name="{author|person|escape}" email="{author|email| 
escape}" />
     <description>{desc|strip|escape}</description>
</changeset>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1875 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial/attachments/20080316/6af0b9f1/attachment.bin 


More information about the Mercurial mailing list