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

Re: svn commit: r12837 - in trunk: doc/book/book subversion/clients/cmdline tools/client-side

From: <kfogel_at_collab.net>
Date: 2005-01-31 23:21:33 CET

julianfoad@tigris.org writes:
> --- trunk/subversion/clients/cmdline/ls-cmd.c (original)
> +++ trunk/subversion/clients/cmdline/ls-cmd.c Mon Jan 24 16:34:29 2005
> @@ -114,6 +116,109 @@
> }
>
>
> +static const char *
> +kind_str (svn_node_kind_t kind)
> +{
> + switch (kind)
> + {
> + case svn_node_dir:
> + return "dir";
> + case svn_node_file:
> + return "file";
> + default:
> + return "";
> + }
> +}
> +
> +
> +static svn_error_t *
> +print_dirents_xml (apr_hash_t *dirents,
> + const char *path,
> + svn_client_ctx_t *ctx,
> + apr_pool_t *pool)
> +{
> + /* Collate whole list into sb before printing. */
> + svn_stringbuf_t *sb = svn_stringbuf_create ("", pool);
> +
> + apr_array_header_t *array;
> + int i;
> +
> + array = svn_sort__hash (dirents, svn_sort_compare_items_as_paths, pool);
> +
> + /* "<list path=...>" */
> + svn_xml_make_open_tag (&sb, pool, svn_xml_normal, "list",
> + "path", path[0] == '\0' ? "." : path,
> + NULL);
> +
> + for (i = 0; i < array->nelts; ++i)
> + {
> + const char *utf8_entryname;
> + svn_dirent_t *dirent;
> + svn_sort__item_t *item;
> +
> + if (ctx->cancel_func)
> + SVN_ERR (ctx->cancel_func (ctx->cancel_baton));
> +
> + item = &APR_ARRAY_IDX (array, i, svn_sort__item_t);
> +
> + utf8_entryname = item->key;
> +
> + dirent = apr_hash_get (dirents, utf8_entryname, item->klen);
> +
> + /* "<entry ...>" */
> + svn_xml_make_open_tag (&sb, pool, svn_xml_protect_pcdata, "entry",
> + "kind", kind_str (dirent->kind),
> + NULL);

Hmm, we don't plan to have any PCDATA in "entry", so why
protect_pcdata here? Passing it means there's no newline after the
opening tag, so the output currently looks like this:

   <entry
      kind="file"><name>CHANGES</name>
   <size>83436</size>
   <commit
      revision="12788"><author>breser</author>
   <date>2005-01-19T06:57:53.337455Z</date>
   </commit>
   </entry>

instead of like this:

   <entry
      kind="file">
   <name>CHANGES</name>
   <size>83436</size>
   <commit
      revision="12788">
   <author>breser</author>
   <date>2005-01-19T06:57:53.337455Z</date>
   </commit>
   </entry>

Same goes for "<commit ...>", though I haven't bothered to quote that
code here, it's pretty easy to find :-). Are there any other elements
that contain no PCDATA?

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jan 31 23:35:04 2005

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.