Output of log and status as XML
Paul R
paul.r.ml at gmail.com
Tue Apr 29 16:23:32 UTC 2008
Paul R <paul.r.ml at gmail.com> writes:
> Hi,
>
> we are working at better integration of mercurial with Redmine web
> tracking system. Subversion 'svn log --xml' facility comes very handy
> in this case, as it provides easy-to-parse information.
> Is there a project to have a standard XML output integrated into HG ?
> I could write my own syntax using templates, but I'd better help with
> a standard if there is already some work in this area.
> Thanks,
After some digging around, it turned out that there is no such facility
currently in Mercurial. To see really what is needed, try this command
on an subversion repository (use -r option to narrow output) :
;; svn log --xml --verbose
You will see a correctly formated xml file with one entry per relevant
path (changed, added, removed, copied). This output is often use by
tracking tools wanting to integrate with SVN, as it is really a good
way to extract information.
Please consider this as a feature request.
The not-really-pretty (and hopefully transient) workaround I made is
to use
;; hg log --debug -C --style my-hg-output.tmpl
where my-hg-output.tmpl is below.
,----[ my-hg-output.tmpl ]
| changeset = 'This template must be used with --debug option\n'
| changeset_quiet = 'This template must be used with --debug option\n'
| changeset_verbose = 'This template must be used with --debug option\n'
| changeset_debug = '<logentry>\n<revision>{rev}</revision>\n<node>{node}</node>\n<author>{author|escape}</author>\n<date>{date|date}</date>\n{files}{file_adds}{file_dels}{file_copies}<description>{desc|strip|escape|addbreaks}</description>\n</logentry>\n\n'
| start_files = '<paths type="modified">'
| file = ' {file|urlescape}'
| end_files = '</paths>\n'
| start_file_adds = '<paths type="added">'
| file_add = ' {file_add|urlescape}'
| end_file_adds = ' </paths>\n'
| start_file_dels = '<paths type="removed">'
| file_del = ' {file_del|urlescape}'
| end_file_dels = '</paths>\n'
| start_file_copies = '<paths type="copied">'
| file_copy = '{source|urlescape}!{name|urlescape} '
| end_file_copies = '</paths>\n'
`----
--
Paul
More information about the Mercurial
mailing list