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

Re: pre-commit script to limit file size

From: <kfogel_at_collab.net>
Date: 2005-01-08 05:30:04 CET

Dan Bikel <dbikel@cis.upenn.edu> writes:
> Hi. I am trying to write a pre-commit script that exits with a value
> of 1 if any of the changed files is a new (added) file that is over a
> certain (large) size. This is to help prevent the accidental
> committing of large, binary files that shouldn't be in a particular
> repository I'm setting up for source code only.
>
> Is there any way to do this without having to use
> svnloook -t $TXN cat $REPOS $filepath
> ?
>
> It seems silly to have to cat the entire file to be added simply to
> compute its size. The output of the 'svn list' command does the right
> thing (lists file size in bytes), but that seems to be available only
> for committed revisions, not transactions that have yet to be
> committed.

If you have some language bindings installed, you could write a (say)
Perl or Python script to directly examine the txn in the repository.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sat Jan 8 05:37:35 2005

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