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

Re: pre commit trigger

From: Irfan Sayed <irfu.sayed_at_gmail.com>
Date: Tue, 12 May 2009 17:05:37 +0530

Hi All,

i am using following command to check whether file is added or modified.
*svnlook changed -r <revesion_no> <path_to_repo>*
this command will give the changes related to revesion which is already
commited
but my doubt is that how should i get the revesion no which is being
commited so that i can pass that no. to this command.

i believe that svnlook changed command only give me the file path name which
is being added

please advise

Regards
irf

On Mon, May 11, 2009 at 8:55 PM, David Weintraub <qazwart_at_gmail.com> wrote:

> The Transaction number is a way of identifying the list of files that
> are affected by the transaction. Think of it as a parallel to the
> revision number. If I specify a particular revision:
>
> $ svnlook log -r1234 repository/path
>
> This will list all the files that were commited in revision #1234 of
> Subversion. Similar to this command:
>
> $ svn log -r1234 file://repository/path
>
> If I specify the transaction number, it will give me the log of the
> POSSIBLE revision that I am about to commit:
>
> TXN=$2
> svnlook -t $TXN repository/path
>
> Now, I'll get the list of files that are in the subversion commit
> transaction I'm parsing.
>
> By the way, I already have a Perl trigger that does this very thing.
> It actually is a bit more flexible in that you can ban any file names
> you want. For example, on Windows machines, you can't have a file
> named con.* or prn.* or any combination where con or prn are followed
> by a number. In mixed Unix/Windows, you want to make sure your Unix
> people aren't creating a file called con2.java which the Windows
> people can't check out.
>
> The trigger also handles commit access on files, and protects your
> tags directory by allowing people to add tags, but not to change the
> files under the tags directory. As an added bonus, it also checks
> files to see if required attributes have been placed upon them.
>
> You can get the trigger from <http://dl.getdropbox.com/u/433257/hooks.zip
> >.
>
> On Mon, May 11, 2009 at 8:13 AM, Irfan Sayed <irfu.sayed_at_gmail.com> wrote:
> > Hi All,
> >
> > I am writting pre commit trigger which will restrict users from adding
> > file/dir names if they contain any white spaces.
> > i red the pre-commit.tmpl file and it gives two arguments to pass to the
> > script
> > i have written one simple perl script which will take two arguments
> passed
> > by pre-commit and ;check whether the path which is getting added in svn
> has
> > space or not if it is then it will exit with sttaus 1
> >
> > two argumenst are REPOS and TXN . my assumption is that TXN is nothing
> but
> > the path which is getting added
> > REPOS is nothing but name of the repositotry
> > is this correct??
> >
> > but with this assumption the script is not working
> >
> > pease advice
> >
> > Regards
> > Irf.
> >
>
>
>
> --
> David Weintraub
> qazwart_at_gmail.com
>

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2211231

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-05-12 13:36:54 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.