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

Re: [PATCH] 'svn info --xml' - v2

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2005-08-01 21:52:03 CEST

Alexander Thomas wrote:
> On Sun, 2005-07-31 at 18:52 +0100, Julian Foad wrote:
>>The existing plain-text "svn info" function, print_info(), should also use this
>>function, unless we want an unlocalised version for XML and a localised version
>>for plain text ... which I suppose we do. And print_info() currently also
>>printfs "none" and "unknown" which is really rather silly, so we'd have to make
>>a decision on what it really ought to be doing if it somehow encounters those
>>node kinds. OK, forget about print_info() for now.
> I too feel same with "none" and "unknown". So I changing the code
> fragment as below.
> SVN_ERR (svn_cmdline_printf (pool, _("Node Kind: %s\n"),
> svn_cl__node_kind_str (info->kind)));

Hmm... as I said, I suppose we want the strings to be translated into the local
human language for plain text output but not for XML output. Don't worry, I'll
fix that up if necessary (if other people agree).

>>>+ make_tagged_cdata (&sb, pool, svn_xml_protect_pcdata,
>>>+ "copied-from-rev", apr_psprintf (pool,
>>>+ "%" APR_OFF_T_FMT, info->copyfrom_rev));
>>info-cmd.c:217: warning: long long int format, different type arg (arg 3)
>>APR_OFF_T_FMT is not the format of a revision number. "%ld" is.
> Sorry I don't get this warning. I am taking this macro from apr.h where
> APR_OFF_T_FMT is defined for "ld". :(

APR_OFF_T_FMT is defined as whatever format string is appropriate for printing
values of type "apr_off_t" on your system. That may be "%ld" on your system,
but it is different on different systems. It is "%lld" on my system.

You are not printing a value of type "apr_off_t", you are printing a value of
type "svn_revnum_t". The correct format string for that is "%ld" on all
systems. We write the "%ld" literally, not using the defined constant
SVN_REVNUM_T_FMT, because use of a defined constant would interfere with the
"_(...)" macro used by "gettext" localisation. So, write:

     apr_psprintf (pool, "%ld", info->copyfrom_rev)

But you don't need to submit another version of the patch just for this; I'll
make the change if there are no other problems when I review it.

Thanks for this new version of the patch. I haven't reviewed it yet.

- Julian

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Aug 1 21:52:40 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.