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

Re: Commit size

From: Johan Corveleyn <jcorvel_at_gmail.com>
Date: Wed, 13 Jun 2012 15:32:56 +0200

On Wed, Jun 13, 2012 at 3:16 PM, Vladimir Shun'kov <shunya.v_at_gmail.com> wrote:
> Would be enough have the number bytes of changes. I did disk usage in
> pre-commit hook and disk usage in post-commit hook and then calculated
> the difference. But I commited the new file with size 20Kb and size of
> commit I recieved only 5Kb due some svn compression I guess.

In 1.7, there's a new svnlook subcommand: 'svnlook filesize'. This can
give you the filesize of any file (from a revision or a transaction),
without having to 'svnlook cat' it (i.e. more efficiently).

Maybe you can use that directly, or use it to calculate the difference?

Like, in the pre-commit hook:

1) 'svnlook changed -t $TXN $REPOS' to get the list of changes in this
transaction

2) For every changed (or added) file, do 'svnlook filesize -t $TXN $REPOS'

3) For changed files, compare them to 'svnlook filesize -r $YOUNGEST
$REPOS' where $YOUNGEST is the result of 'svnlook youngest $REPOS'.

4) Do some arithmetic on the result

HTH

-- 
Johan
Received on 2012-06-13 15:33:53 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.