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

[PATCH] Do 'svn log --xml --incremental'

From: Nuutti Kotivuori <naked_at_iki.fi>
Date: 2002-10-29 19:39:20 CET

Just a quick review before commit, because it's been ages since I last
committed anything.

Log message:
Taught the xml log output to take advantage of the new --incremental
option that was added.

* subversion/clients/cmdline/log-cmd.c (svn_cl__log): Use
opt_state->incremental.

Index: subversion/clients/cmdline/log-cmd.c
===================================================================
--- subversion/clients/cmdline/log-cmd.c (revision 3549)
+++ subversion/clients/cmdline/log-cmd.c (working copy)
@@ -420,20 +420,21 @@
 
   if (opt_state->xml)
     {
- svn_stringbuf_t *sb;
-
- /* The header generation is commented out because it might not
- be certain that the log messages are indeed the advertised
- encoding, UTF-8. The absence of the header should not matter
- to people processing the output, and they should add it
- themselves if storing the output as a fully-formed XML
- document. */
- /* <?xml version="1.0" encoding="utf-8"?> */
- /* svn_xml_make_header (&sb, pool); */
-
- sb = NULL;
- svn_xml_make_open_tag (&sb, pool, svn_xml_normal, "log", NULL);
- printf ("%s", sb->data); /* "<log>" */
+ /* If output is not incremental, output the XML header and wrap
+ everything in a top-level element. This makes the output in
+ it's entirety a well-formed XML document. */
+ if (! opt_state->incremental)
+ {
+ svn_stringbuf_t *sb = svn_stringbuf_create ("", pool);
+
+ /* <?xml version="1.0" encoding="utf-8"?> */
+ svn_xml_make_header (&sb, pool);
+
+ /* "<log>" */
+ svn_xml_make_open_tag (&sb, pool, svn_xml_normal, "log", NULL);
+
+ printf ("%s", sb->data);
+ }
       
       SVN_ERR (svn_client_log (auth_baton,
                                targets,
@@ -445,9 +446,15 @@
                                NULL, /* no baton necessary */
                                pool));
       
- sb = NULL;
- svn_xml_make_close_tag (&sb, pool, "log");
- printf ("%s", sb->data); /* "</log>" */
+ if (! opt_state->incremental)
+ {
+ svn_stringbuf_t *sb = svn_stringbuf_create ("", pool);
+
+ /* "</log>" */
+ svn_xml_make_close_tag (&sb, pool, "log");
+
+ printf ("%s", sb->data);
+ }
     }
   else /* default output format */
     {

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Oct 29 19:40:22 2002

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.