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

Re: What file system structure a SVN transaction follow ?

From: Ravi Roy <ravi.aroy_at_gmail.com>
Date: Fri, 30 Apr 2010 17:10:38 +0530

On Fri, Apr 30, 2010 at 4:02 PM, Itamar O <itamarost_at_gmail.com> wrote:

> On Fri, Apr 30, 2010 at 1:23 PM, Ravi Roy <ravi.aroy_at_gmail.com> wrote:
> >
> >
> > On Fri, Apr 30, 2010 at 3:38 PM, Ryan Schmidt
> > <subversion-2010b_at_ryandesign.com> wrote:
> >>
> >> On Apr 30, 2010, at 04:52, Ravi Roy wrote:
> >>
> >> > I am writing a custom hook (pre-commit) to find out the size of the
> >> > transaction for certain size and then allow / disallow commit. But I
> am not
> >> > sure what is the structure under /db/transactions which should be
> checked
> >> > for size ?
> >>
> >> You don't need to know. :) Instead, use the "svnlook" program to inspect
> >> the transaction for the information you need. For example, "svnlook
> changed"
> >> to see what changed in the transaction, and "svnlook cat" to get the
> >> contents of individual files from the transaction, whose bytes you can
> then
> >> sum up.
> >>
> >
> > Thankd Ryan. Don't you think svnlook cat -t $T > contentsfile would be
> too
> > havy for pre-commit hook to handle and make repo commits slow :-)
> > Suppose somebody is trying to commit 100 MB of file which I want to
> disallow
> > in principle, I think this will cause performace issues.
>
> This will probably add some delay to the process,
> but keep in mind that in the pre-commit part the file was already
> transferred to the server, and this was probably the significant delay.
>
> Unless information about files in the transaction and their sizes is
> available in the start-commit phase (which occurs before the actual
> transfer of content), there's no way to avoid the "big" delay over the
> network.
> Which makes me wonder - is this information available in start-commit..?
>
>
> To answer your question about start-commit hook :

Subversion currently defines nine hooks:

   - The *start-commit* hook is invoked before a transaction is created in
   the process of doing a commit.
   - The *pre-commit* hook is invoked after a transaction has been created
   but before it is committed.
   - The *post-commit* hook is invoked after a transaction is committed.
   - The *pre-revprop-change* and *post-revprop-change* hooks are invoked
   before respectively after a revision property is added, modified, or
   deleted.
   - The *pre-lock* and *post-lock* hooks are invoked before respectively
   after an exclusive lock on a path is created.
   - The *pre-unlock* and *post-unlock* hooks are invoked before
   respectively after an exclusive lock is destroyed.

reference URL :
http://www.collab.net/community/subversion/articles/EnhancingSubversionServer.html

-RR
Received on 2010-04-30 13:41:10 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.