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

Re: [Issue 3770] New - JavaHL method to set binary property is broken

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Thu, 30 Dec 2010 22:32:56 +0200

Hyrum K Wright wrote on Thu, Dec 30, 2010 at 15:03:04 -0500:
> On Thu, Dec 30, 2010 at 2:57 PM, Mark Phippard <markphip_at_gmail.com> wrote:
> > On Thu, Dec 30, 2010 at 2:17 PM, Hyrum K Wright <hyrum_at_hyrumwright.org> wrote:
> >
> >> Mark,
> >> Daniel pointed out on IRC that all the revpropTable arguments in the
> >> JavaHL API are Map<String, String>.  Should they be adjusted to
> >> Map<String, byte[]> ?
> >
> > What is the rule for revision properties?  I thought they had to be
> > UTF-8 strings, in which case the Java String class seems more
> > appropriate than using Byte[] which would imply the user can assign
> > binary values to the property.  If Revision properties can contain
> > binary values, then yes we should not be using String here.
>
> I don't remember what the repository enforces, but the underlying API
> contains a hash of const char * revprop names, with values of
> svn_string_t *, which is our counted string which can contain
> arbitrary binary data.
>
> So the client API allows binary data, but it might be caught further
> down the library stack.
>

% $svn ps --revprop -r0 svn-binary -F =svn wc1
property 'svn-binary' set on repository revision 0
% $svn ps --revprop -r0 random-data -F =(head -c 1024 /dev/urandom) wc1
property 'random-data' set on repository revision 0
% $svn pg --revprop -r0 random-data --strict wc1 | xxd -ps -c1 | grep 00
00
00
00

> -Hyrum
Received on 2010-12-30 21:36:15 CET

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.