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

Re: svn info doesn't work in pre-commit script

From: Hellen <hellenff_at_gmail.com>
Date: Wed, 12 Mar 2008 23:54:39 -0700

thanks for the help. actually, I want to get the current directory path from
"svn info " while using "svn commit". so I can write a script for auto
switch (svn switch --relocate from_URL To_URL) from the mirror side to
master side.

On Wed, Mar 12, 2008 at 2:10 AM, Ryan Schmidt <
subversion-2008a_at_ryandesign.com> wrote:

>
> On Mar 12, 2008, at 03:15, Hellen wrote:
>
> > On Tue, Mar 11, 2008 at 11:31 PM, Hilco Wijbenga wrote:
> >
> >> On Tue, Mar 11, 2008 at 11:19 PM, Hellen wrote:
> >>
> >>> svn: warning: '.' is not a working copy
> >>
> >> I don't think "svn info" is the problem, it's the ".". Your current
> >> directory is presumably the directory of the pre-commit script. I
> >> doubt that's what you meant.
> >>
> >> The pre-commit script gets 2 arguments, try using those.
> >
> > Thanks for your help. But I have also tried using "svn info"
> > without the ".", but It still doesn't work.
> >
> > I changed the following in the start-commit:
> > --------------------------------
> >
> > echo `pwd` >&2
> > svnurl=`/usr/bin/svn info |grep "^URL: "`
> > echo "svnurl:$svnurl" >&2
> > ---------------------------------
> >
> > and here is the result:
> > --------------------------------
> > /home/svn_user
> > svn: '.' is not a working copy
> > svnurl:
> > --------------------------------
> >
> > but I run "svn commit" at: /home/svn_user/tstchout/svn_mirror/
> > testrepo1/trunk/Scripts.test
>
> That's the directory on your client...
>
> > somehow, It just cannot recognize the location of the current
> > directory.
> > does anyone have any idea on this ?
>
> ...but the hook scripts run on the server. The hooks cannot affect
> your client's working copy.
>
> > BTW: I tried those 2 arguments in pre-commit, it just gives me the
> > transaction number and the repository path not my current location.
>
> Correct. The hook does not know the path to the client's working copy.
>
> Let's ask a different question: What are you trying to accomplish?
> Maybe there's a different way to go about it.
>
>
>
Received on 2008-03-13 07:54:59 CET

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.