On Wed, Jun 13, 2012 at 3:16 PM, Vladimir Shun'kov <shuny...@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

Reply via email to