You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Julian Foad <ju...@btopenworld.com> on 2003/09/29 23:07:21 UTC

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

The following change is not open to discussion unless you have a very good objection.  :-)

[[[
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.

* 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

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

Posted by Julian Foad <ju...@btopenworld.com>.
kfogel@collab.net wrote:
> Julian Foad <ju...@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!

Committed in r7251.

- Julian


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

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

Posted by kf...@collab.net.
Julian Foad <ju...@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

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

Posted by Branko Čibej <br...@xbc.nu>.
Files wrote:

>No objection as long as the DTD is published as a separate document
>either way. I think that's more the real problem. A machine can be
>taught if you know what to teach.
>  
>
Good point. The DTD is not only not published, it's not even spelled
out. All I can find is an example in the decstring of
log_message_receiver_xml.


-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

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

Posted by Files <fi...@poetryunlimited.com>.
No objection as long as the DTD is published as a separate document
either way. I think that's more the real problem. A machine can be
taught if you know what to teach.

On Mon, 2003-09-29 at 19:07, Julian Foad wrote:
> The following change is not open to discussion unless you have a very good objection.  :-)
> 
> [[[
> 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.
> 
---
Shamim Islam
BA BS


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org