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

Re: [PATCH] issue #2069 - "svn status" in xml mode - v5

From: Peter N. Lundblad <peter_at_famlundblad.se>
Date: 2005-05-31 22:25:23 CEST

On Tue, 31 May 2005, Alexander Thomas wrote:

> On Mon, 2005-05-30 at 23:41 +0200, Peter N. Lundblad wrote:
>
> > > + svn_xml_make_open_tag (&sb, pool, svn_xml_normal, "lock", NULL);
> > > +
> > > + svn_xml_make_open_tag (&sb, pool, svn_xml_protect_pcdata, "token", NULL);
> > > + svn_xml_escape_cdata_cstring (&sb, status->repos_lock->token, pool);
> > > + svn_xml_make_close_tag (&sb, pool, "token");
> > > +
> > > + svn_xml_make_open_tag (&sb, pool, svn_xml_protect_pcdata, "owner", NULL);
> > > + svn_xml_escape_cdata_cstring (&sb, status->repos_lock->owner, pool);
> > > + svn_xml_make_close_tag (&sb, pool, "owner");
> > > +
> > > + if (status->repos_lock->comment)
> > > + {
> > > + /* "<comment>xx</comment>" */
> > > + svn_xml_make_open_tag (&sb, pool, svn_xml_normal, "comment", NULL);
> > > + svn_xml_escape_cdata_cstring (&sb, status->repos_lock->comment, pool);
> > > + svn_xml_make_close_tag (&sb, pool, "comment");
> > > + }
> > > +
> > > + /* "<created>xx</created>" */
> > > + svn_xml_make_open_tag (&sb, pool, svn_xml_protect_pcdata,
> > > + "created", NULL);
> > > + svn_xml_escape_cdata_cstring (&sb, svn_time_to_cstring
> > > + (status->repos_lock->creation_date,
> > > + pool),
> > > + pool);
> > > + svn_xml_make_close_tag (&sb, pool, "created");
> > > +
> > > + if (status->repos_lock->expiration_date != 0)
> > > + {
> > > + svn_xml_make_open_tag (&sb, pool, svn_xml_protect_pcdata,
> > > + "expires", NULL);
> > > + svn_xml_escape_cdata_cstring (&sb, svn_time_to_cstring
> > > + (status->repos_lock->expiration_date,
> > > + pool),
> > > + pool);
> > > + svn_xml_make_close_tag (&sb, pool, "expires");
> > > + }
> > > +
> > > + /* "</lock>" */
> > > + svn_xml_make_close_tag (&sb, pool, "lock");
> > > +
> > > + /* "</repos-status>"*/
> > > + svn_xml_make_close_tag (&sb, pool, "repos-status");
> > > + }
> > > +
> > Hmmm... I think the last committed info could be added here as well. I
> > > don't know if it was in the original patch and I forgot it when I
> > > rewrote the DTD:-( BTW, the DTD is missing from this patch.
> >
>
> last commited info ?
>
Last changed revision and author and date for that revision. But maybe we
can leave that out for the moment. You can get it via svn info. We can
easily add it later if people ask for it.

> > > +{
> > > + svn_stringbuf_t *sb = svn_stringbuf_create ("", pool);
> > > +
> > > + if (SVN_IS_VALID_REVNUM (repos_rev) && update)
> > > + {
> > > + const char *repos_rev_str;
> > > + repos_rev_str = apr_psprintf (pool, "%" APR_OFF_T_FMT, repos_rev);
> >
> > Use %ld for revision numbers. (That has to do with gettext, which
> > doesn't understand such macros.)
> >
> I think %ld needed not be identified by gettext, after all this is
> going in to xml output.
>
I just explained why we have that convention. Before we added gettext
support last spring, we used SVN_REVNUM_T_FMT (in svn_types.h) to print
revision numbers. That was problematic with gettext. So we decided to
change all occurences of that macro to ld. There is no point in using the
macro, since we can't possibly change the type anyway, so we use %ld
everywhere in the svn code.

> > > + err = svn_client_status2 (&repos_rev, target, &rev, print_status, &sb,
> > > + opt_state->nonrecursive ? FALSE : TRUE,
> > > + (opt_state->verbose || opt_state->xml),
> >
> > I don't think XML mode should imply --verbose *in this case*. I think
> > --verbose makes sense for XML, since. Otherwise status will output
> > lots of useless entries for unmodified paths. I normally argue that
> > we should print all available information in XML and that the
> > receiving application can filter it. I'm not consistent, I know, but
> > this would be extreme:-)
> >
>
> Why, what is so exceptional about status ?
>
--verbose outputs an entry for every path in the working copy instead of
just "interesting" paths. That adds *lots* of commonly useless stuff. We
have the same in svn log --xml. There, the changed path info is not
written unless --verbose was specified, albeit for a somewhat different
reason. It would mean lots of extra information sent from server to
client.

> So you want me to remove opt_state->xml and if user wants detailed xml
> output, they had to give explicit --verbose cmdline option
>
Exactly. Try your patch on a big WC and you'll see what I mean:-)

Thanks,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue May 31 22:15:43 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.