You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by da...@fastmail.co.uk on 2009/05/15 13:26:39 UTC

inaccurate size reported by svn ls

Hi,

I notice that svn ls appears to report size inaccurately:

svn cat http://.../file | wc -c
1855

vs

svn ls --xml http://.../file

...
<size>1710</size>
...

I get the same result if I log into the server and svn ls the file via
the
file:// protocol.

Am I misunderstanding what size is supposed to be, or is this a bug?

client and server are both 1.5.4, server is using FSFS.

Dave
-- 
  
  dave_rodgman@fastmail.co.uk

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2270930

Re: inaccurate size reported by svn ls

Posted by da...@fastmail.co.uk.
On Fri, 15 May 2009 09:31 -0400, "C. Michael Pilato"
<cm...@collab.net> wrote:
> dave_rodgman@fastmail.co.uk wrote:
> > Hi,
> > 
> > I notice that svn ls appears to report size inaccurately:
> > 
> > svn cat http://.../file | wc -c
> > 1855
> > 
> > vs
> > 
> > svn ls --xml http://.../file
> > 
> > ...
> > <size>1710</size>
> 
> [This is borderline off-topic for a list devoted to the development of
> Subversion.]
> 
> 'svn cat' takes into account newline conversion and keyword expansion. 
> So,
> if you're on Windows, it would be common for 'svn cat's output to contain
> double the end-of-line characters (since repository normal form is
> line-feed
> only, where Windows typical form is carriage-return + line-feed).  And if
> there are keywords to be expanded client side, that adds more bulk.  Does
> this explain your specific situation?

Ah, I'd forgotten about the keyword expansion. That explains it, thanks.

It's not clear that this is the right thing for svn to report though.
Keyword
expansion is enabled by properties on the file, not by a particular
client, so
all well-behaved clients (I assume) must expand the keywords when
presenting
the file.

It seems wrong that when presenting the file in full (as in svn cat)
it's done
with keywords expanded, but not when presenting a summary of the file.

thanks

Dave


> 
> -- 
> C. Michael Pilato <cm...@collab.net>
> CollabNet   <>   www.collab.net   <>   Distributed Development On Demand
> 
-- 
  
  dave_rodgman@fastmail.co.uk

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2271108

Re: inaccurate size reported by svn ls

Posted by "C. Michael Pilato" <cm...@collab.net>.
dave_rodgman@fastmail.co.uk wrote:
> Hi,
> 
> I notice that svn ls appears to report size inaccurately:
> 
> svn cat http://.../file | wc -c
> 1855
> 
> vs
> 
> svn ls --xml http://.../file
> 
> ...
> <size>1710</size>

[This is borderline off-topic for a list devoted to the development of
Subversion.]

'svn cat' takes into account newline conversion and keyword expansion.  So,
if you're on Windows, it would be common for 'svn cat's output to contain
double the end-of-line characters (since repository normal form is line-feed
only, where Windows typical form is carriage-return + line-feed).  And if
there are keywords to be expanded client side, that adds more bulk.  Does
this explain your specific situation?

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2270950