using template to distinguish between files and files with spaces
Matt Mackall
mpm at selenic.com
Mon Mar 17 15:43:32 CDT 2008
On Sun, 2008-03-16 at 14:47 -0700, Jens Alfke wrote:
> 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>
That looks very handy. Perhaps we should ship something like this
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial
mailing list