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

Re: [SVN] Re: Getting file content in pre-commit

From: James CE Johnson <jcej_at_tragus.org>
Date: Fri, 16 May 2008 15:05:03 -0400 (EDT)

It must be Monday and nobody told me...

I did, indeed, try 'svnlook cat' before posting and came up with the
vacuum of space for newly-added files. After a reimplementation inspired
by your comments all is working perfectly now.

For anyone who is also having a Monday on this Friday afternoon, here is
the partial solution in my pre-commit hook:

 for i in $(${SVNLOOK} changed -t ${TXN} ${REPOS} | grep '^[AU]')
 do
   echo "-- $i --"
   ${SVNLOOK} cat -t ${TXN} ${REPOS} $i
 done

Thanks Larry!

> svnlook cat will take the transaction (uncommitted) as well as a revision
> (committed already). Look at svnlook help cat
>
> You will need to get a list of the files in the transaction, so svnlook
> help
> changed will give you help.
>
> -- Larry
>
> On Fri, May 16, 2008 at 12:20 PM, James CE Johnson <jcej_at_tragus.org>
> wrote:
>
>> Hi,
>>
>> I have a need to capture the content of files being committed. Not to
>> change them but to analyze for one thing or another. For instance, we
>> might fail the commit if a file is too big or fails formatting rules
>> (e.g.
>> -- source code) or for some other metric.
>>
>> I've tried "svnlook cat ..." but since the file hasn't been committed
>> yet
>> that doesn't show me the content of new files or the updated content of
>> changed files. I thought I might use a combination of cat/diff to create
>> a
>> patch but that won't help me with binary files (so, failing large-file
>> commits).
>>
>> Ideas?
>>
>> Thanks,
>> James
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
>> For additional commands, e-mail: users-help_at_subversion.tigris.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-05-16 20:54:24 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.