[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: XML output of "svn log" should omit unknown values.

From: <kfogel_at_collab.net>
Date: 2003-09-30 04:13:14 CEST

Julian Foad <julianfoad@btopenworld.com> writes:
> [[[
> Make XML output from "svn log" omit unknown values, rather than contain
> fixed strings like "(no author)", so that the meaning is programmatically
> obvious, language-neutral, etc.

This is so obviously right that I'm tempted to object just to see if
I'm mentally dextrous enough to come up with a plausible-sounding
justification... But I can't :-). +1, and thanks!

-Karl

> * subversion/clients/cmdline/log-cmd.c
> (log_message_receiver_xml) Omit <author> and/or <date> elements if the
> respective data are missing.
> ]]]
>
> Index: subversion/clients/cmdline/log-cmd.c
> ===================================================================
> --- subversion/clients/cmdline/log-cmd.c (revision 7248)
> +++ subversion/clients/cmdline/log-cmd.c (working copy)
> @@ -352,24 +352,24 @@ log_message_receiver_xml (void *baton,
> svn_xml_make_open_tag (&sb, pool, svn_xml_normal, "logentry",
> "revision", revstr, NULL);
>
> - if (author == NULL)
> - author = "(no author)";
> + if (author)
> + {
> + /* <author>xxx</author> */
> + svn_xml_make_open_tag (&sb, pool, svn_xml_protect_pcdata, "author",
> + NULL);
> + svn_xml_escape_cdata_cstring (&sb, author, pool);
> + svn_xml_make_close_tag (&sb, pool, "author");
> + }
>
> - /* <author>xxx</author> */
> - svn_xml_make_open_tag (&sb, pool, svn_xml_protect_pcdata, "author",
> - NULL);
> - svn_xml_escape_cdata_cstring (&sb, author, pool);
> - svn_xml_make_close_tag (&sb, pool, "author");
> -
> - if (date == NULL)
> - date = "(no date)";
> -
> - /* Print the full, uncut, date. This is machine output. */
> - /* <date>xxx</date> */
> - svn_xml_make_open_tag (&sb, pool, svn_xml_protect_pcdata, "date",
> - NULL);
> - svn_xml_escape_cdata_cstring (&sb, date, pool);
> - svn_xml_make_close_tag (&sb, pool, "date");
> + if (date)
> + {
> + /* Print the full, uncut, date. This is machine output. */
> + /* <date>xxx</date> */
> + svn_xml_make_open_tag (&sb, pool, svn_xml_protect_pcdata, "date",
> + NULL);
> + svn_xml_escape_cdata_cstring (&sb, date, pool);
> + svn_xml_make_close_tag (&sb, pool, "date");
> + }
>
> if (changed_paths)
> {
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Sep 30 05:04:01 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.