You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by David Simpson <hd...@gmail.com> on 2005/01/20 07:12:03 UTC

Getting File sizes in Commit Hook

Can I get the size of the files from within the Commit hook?  I want
to stop large files from being accidentally committed to the
repository.

Thanks
David

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Getting File sizes in Commit Hook

Posted by Simon Comeau Martel <ma...@videotron.ca>.
David Simpson wrote:
> Can I get the size of the files from within the Commit hook?  I want
> to stop large files from being accidentally committed to the
> repository.

I hope the attached script can help you.
My way of calculating files size is not really efficient, but I guess
it's better than noting...


-- 
Simon Comeau Martel
martelsc@videotron.ca


Re: Getting File sizes in Commit Hook

Posted by kf...@collab.net.
David Simpson <hd...@gmail.com> writes:
> Can I get the size of the files from within the Commit hook?  I want
> to stop large files from being accidentally committed to the
> repository.

Unfortunately, 'svnlook' doesn't retrieve this information in
convenient form.  Your best bet is to write a program using the
language bindings (i.e., in Python, Perl, or Java).  A non-elegant
workaround would be to use 'svnlook cat' to put the file's contents
into a tmp file outside the repository, then examine the tmp file's
size.

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org