cmpilato@tigris.org wrote:
>            void *val;
> -          char action;
>            char *actionstr;
> -
> +          svn_log_changed_path_t *log_item;
>            apr_hash_this(hi, (void *) &path, NULL, &val);
> -          action = (char) ((int) val);
> +          log_item = val;
>  
> -          actionstr = apr_psprintf (pool, "%c", action);
> -          /* <path action="X">xxx</path> */
> -          svn_xml_make_open_tag (&sb, pool, svn_xml_protect_pcdata, "path",
> -                                 "action", actionstr, NULL);
> +          actionstr = apr_psprintf (pool, "%c", log_item->action);
> +          if (log_item->copyfrom_path
> +              && SVN_IS_VALID_REVNUM (log_item->copyfrom_rev))
> +            {
> +              /* <path action="X" copyfrom-path="aaa" copyfrom-rev="> */
> +              svn_stringbuf_t *escpath = svn_stringbuf_create ("", pool);
> +              svn_xml_escape_nts (&escpath, log_item->copyfrom_path, pool);
> +              revstr = apr_psprintf (pool, "%" SVN_REVNUM_T_FMT, 
> +                                     log_item->copyfrom_rev);
> +              svn_xml_make_open_tag (&sb, pool, svn_xml_protect_pcdata, "path",
> +                                     "action", actionstr, 
> +                                     "copyfrom-path", escpath->data,
> +                                     "copyfrom-rev", revstr, NULL);
> +            }
> +          else
> +            {
> +              /* <path action="X"> */
> +              svn_xml_make_open_tag (&sb, pool, svn_xml_protect_pcdata, "path",
> +                                     "action", actionstr, NULL);
> +            }
> +          /* xxx</path> */
>            svn_xml_escape_nts (&sb, path, pool);
>            svn_xml_make_close_tag (&sb, pool, "path");
>          }
I don't like the schema at all. Consider:
<paths>
  <path action="A" copyfrom-path="trunk/subversion/clients/cmdline/log-cmd.c"
  copyfrom-rev="1234">trunk/subversion/clients/cmdline/foobar.c</path>
</paths>
and:
<paths>
  <path action="M">trunk/subversion/clients/cmdline/foobar.c</path>
</paths>
The usage of attributes versus content is quite inconsistent.
I have three alternatives:
<paths>
  <action type="A">
    <path>
      trunk/subversion/clients/cmdline/foobar.c
    </path>
    <copyfrom revision="1234">
      trunk/subversion/clients/cmdline/log-cmd.c
    </copyfrom>
  </action>
</paths>
<paths>
  <action type="A">
    <path>
      trunk/subversion/clients/cmdline/foobar.c
    </path>
    <copyfrom>
      <revision>1234</revision>
      <path>
        trunk/subversion/clients/cmdline/log-cmd.c
      </path>
    </copyfrom>
  </action>
</paths>
<paths>
  <action
    type="A"
    copyfrom-rev="1234"
    copyfrom-path="trunk/subversion/clients/cmdline/log-cmd.c"
    path="trunk/subversion/clients/cmdline/foobar.c" />
</paths>
Ofcourse more permutations can be thought up.
The last one is probably the one that most directly matches the way
normal log works - all others seem to suggest that there may be
something more on the way.
...not that anyone else would be using the --xml options for anything
;)
-- Naked
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jul 25 23:09:17 2002