You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by JD <me...@gmail.com> on 2008/02/22 14:28:13 UTC

Frustration with Hooks

Hello.  I'm a new user to Subversion (Windows).  The program works pretty
well for myself and the job where I am implementing it (a web design
business), but I have a problem.  What I want to do is use the post commit
hook .bat file to check out a copy of the repository to a folder on another
machine (either network drive or UNC path), cleanup the repository and
unlock all files.  With this we can have the mirror on a live (albeit
secure) site where clients could log in and check it out.

I wrote the .bat file and it runs fine manually ... but it does not work
when running with the hook.  I know the hook is being called, as I did some
tests where it creates folders and files on C:\, which it does, but when it
comes to a network drive it won't do anything.  The original bat file went
something like this (I forget off the top of my head if it is svn or
svnadmin):

mkdir C:\testone\
svn co  http://acmegenericsite.com/repository location
\\networkmachine\intended_mirror
svn cleanup \\networkmachine\intended_mirror
svn update \\networkmachine\intended_mirror
mkdir C:\testtwo\

The folder creation works, but subversion won't even touch the network
drive.  I've given Apache permissions on both machines to do whatever it
needs (e.g. a user with permissions on the specified folders, with the
network drive set to accept it), but that doesn't help.  It also doesn't
change anything if I map the UNC path to X:\.

I had the grand idea later to do something different: I had subversion
create said local mirror on my C:\ and then use the bat file to xcopy it to
the network drive.  Frustratingly, that doesn't work either. The copy
command works, but that only copies files in the directory itself, not in
the subdirectories.  I know xcopy needs parameters to copy subdirectories,
but even those don't help in this situation.  I've been working on this for
awhile and it is driving me crazy.  If anyone has any possible solution, it
would be greatly appreciated.

Thank you.

-JD

Re: Frustration with Hooks

Posted by JD <me...@gmail.com>.
On Fri, Feb 22, 2008 at 9:47 AM, JD <me...@gmail.com> wrote:

> Either way, it works.  I owe all of you a beer.
>
> This is the working script:
>
> "C:\Program Files\Subversion\bin\svn.exe" co
> file:///C:/Repositories/myrepository \\theserver\mirrorfolder\
> "C:\Program Files\Subversion\bin\svn.exe" cleanup
> \\theserver\mirrorfolder\
> "C:\Program Files\Subversion\bin\svn.exe" update \\theserver\mirrorfolder\
>
> Thank you all very, very much.
>
> -JD
>
>
> On Fri, Feb 22, 2008 at 9:17 AM, Mark Phippard <ma...@gmail.com> wrote:
>
> > On Fri, Feb 22, 2008 at 10:14 AM, JD <me...@gmail.com> wrote:
> > > Again, thank you.  Why would Xcopy not work, though? Would I also need
> > to
> > > refer to a direct path for it?
> >
> > Not sure what you are referring to, but xcopy would be no different
> > than any other code.  If the account cannot access the network then it
> > can't.
> >
> > Mark
> >
>
>

Re: Frustration with Hooks

Posted by Mark Phippard <ma...@gmail.com>.
On Fri, Feb 22, 2008 at 10:14 AM, JD <me...@gmail.com> wrote:
> Again, thank you.  Why would Xcopy not work, though? Would I also need to
> refer to a direct path for it?

Not sure what you are referring to, but xcopy would be no different
than any other code.  If the account cannot access the network then it
can't.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Frustration with Hooks

Posted by Mark Phippard <ma...@gmail.com>.
On Fri, Feb 22, 2008 at 9:34 AM, Andy Levy <an...@gmail.com> wrote:
> On Fri, Feb 22, 2008 at 9:28 AM, JD <me...@gmail.com> wrote:
>  > The folder creation works, but subversion won't even touch the network
>  > drive.  I've given Apache permissions on both machines to do whatever it
>  > needs (e.g. a user with permissions on the specified folders, with the
>  > network drive set to accept it), but that doesn't help.  It also doesn't
>  > change anything if I map the UNC path to X:\.
>
>  Subversion's hook scripts are run in a nearly-empty environment for
>  security reasons. Try specifying the full path to your svn.exe.
>
>  Mapping a drive definitely won't help, because drive mappings are only
>  for the logged-on user.

I will also add that the Apache service will have to be changed so
that it is running as an account with the necessary credentials to
access those network resources.  The default account that a Windows
service runs as does not have permission to access network resources.
If you are in an Active Directory domain you need to have Apache run
as an account from the domain with necessary access rights.

-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Frustration with Hooks

Posted by Andy Levy <an...@gmail.com>.
On Fri, Feb 22, 2008 at 9:41 AM, JD <me...@gmail.com> wrote:
> Thank you for the prompt response, I appreciate it.  Where would I specify
> the full path  Would I do that in place of the svn commands?  Also, is the
> reason xcopy not working due to a lack of usernames and passwords?

mkdir C:\testone\
"c:\program files\subversion\bin\svn.exe" co
http://acmegenericsite.com/repository location
\\networkmachine\intended_mirror
"c:\program files\subversion\bin\svn.exe" cleanup
\\networkmachine\intended_mirror
"c:\program files\subversion\bin\svn.exe" update
\\networkmachine\intended_mirror
mkdir C:\testtwo\


> On Fri, Feb 22, 2008 at 8:34 AM, Andy Levy <an...@gmail.com> wrote:
>
>
> >
> >
> >
> > On Fri, Feb 22, 2008 at 9:28 AM, JD <me...@gmail.com> wrote:
> > > Hello.  I'm a new user to Subversion (Windows).  The program works
> pretty
> > > well for myself and the job where I am implementing it (a web design
> > > business), but I have a problem.  What I want to do is use the post
> commit
> > > hook .bat file to check out a copy of the repository to a folder on
> another
> > > machine (either network drive or UNC path), cleanup the repository and
> > > unlock all files.  With this we can have the mirror on a live (albeit
> > > secure) site where clients could log in and check it out.
> > >
> > > I wrote the .bat file and it runs fine manually ... but it does not work
> > > when running with the hook.  I know the hook is being called, as I did
> some
> > > tests where it creates folders and files on C:\, which it does, but when
> it
> > > comes to a network drive it won't do anything.  The original bat file
> went
> > > something like this (I forget off the top of my head if it is svn or
> > > svnadmin):
> > >
> > > mkdir C:\testone\
> > > svn co  http://acmegenericsite.com/repository location
> > > \\networkmachine\intended_mirror
> > > svn cleanup \\networkmachine\intended_mirror
> > > svn update \\networkmachine\intended_mirror
> > >  mkdir C:\testtwo\
> > >
> > > The folder creation works, but subversion won't even touch the network
> > > drive.  I've given Apache permissions on both machines to do whatever it
> > > needs (e.g. a user with permissions on the specified folders, with the
> > > network drive set to accept it), but that doesn't help.  It also doesn't
> > > change anything if I map the UNC path to X:\.
> >
> > Subversion's hook scripts are run in a nearly-empty environment for
> > security reasons. Try specifying the full path to your svn.exe.
> >
> > Mapping a drive definitely won't help, because drive mappings are only
> > for the logged-on user.
> >
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Frustration with Hooks

Posted by JD <me...@gmail.com>.
Thank you for the prompt response, I appreciate it.  Where would I specify
the full path  Would I do that in place of the svn commands?  Also, is the
reason xcopy not working due to a lack of usernames and passwords?


On Fri, Feb 22, 2008 at 8:34 AM, Andy Levy <an...@gmail.com> wrote:

> On Fri, Feb 22, 2008 at 9:28 AM, JD <me...@gmail.com> wrote:
> > Hello.  I'm a new user to Subversion (Windows).  The program works
> pretty
> > well for myself and the job where I am implementing it (a web design
> > business), but I have a problem.  What I want to do is use the post
> commit
> > hook .bat file to check out a copy of the repository to a folder on
> another
> > machine (either network drive or UNC path), cleanup the repository and
> > unlock all files.  With this we can have the mirror on a live (albeit
> > secure) site where clients could log in and check it out.
> >
> > I wrote the .bat file and it runs fine manually ... but it does not work
> > when running with the hook.  I know the hook is being called, as I did
> some
> > tests where it creates folders and files on C:\, which it does, but when
> it
> > comes to a network drive it won't do anything.  The original bat file
> went
> > something like this (I forget off the top of my head if it is svn or
> > svnadmin):
> >
> > mkdir C:\testone\
> > svn co  http://acmegenericsite.com/repository location
> > \\networkmachine\intended_mirror
> > svn cleanup \\networkmachine\intended_mirror
> > svn update \\networkmachine\intended_mirror
> >  mkdir C:\testtwo\
> >
> > The folder creation works, but subversion won't even touch the network
> > drive.  I've given Apache permissions on both machines to do whatever it
> > needs (e.g. a user with permissions on the specified folders, with the
> > network drive set to accept it), but that doesn't help.  It also doesn't
> > change anything if I map the UNC path to X:\.
>
> Subversion's hook scripts are run in a nearly-empty environment for
> security reasons. Try specifying the full path to your svn.exe.
>
> Mapping a drive definitely won't help, because drive mappings are only
> for the logged-on user.
>

Re: Frustration with Hooks

Posted by Andy Levy <an...@gmail.com>.
On Fri, Feb 22, 2008 at 9:28 AM, JD <me...@gmail.com> wrote:
> Hello.  I'm a new user to Subversion (Windows).  The program works pretty
> well for myself and the job where I am implementing it (a web design
> business), but I have a problem.  What I want to do is use the post commit
> hook .bat file to check out a copy of the repository to a folder on another
> machine (either network drive or UNC path), cleanup the repository and
> unlock all files.  With this we can have the mirror on a live (albeit
> secure) site where clients could log in and check it out.
>
> I wrote the .bat file and it runs fine manually ... but it does not work
> when running with the hook.  I know the hook is being called, as I did some
> tests where it creates folders and files on C:\, which it does, but when it
> comes to a network drive it won't do anything.  The original bat file went
> something like this (I forget off the top of my head if it is svn or
> svnadmin):
>
> mkdir C:\testone\
> svn co  http://acmegenericsite.com/repository location
> \\networkmachine\intended_mirror
> svn cleanup \\networkmachine\intended_mirror
> svn update \\networkmachine\intended_mirror
>  mkdir C:\testtwo\
>
> The folder creation works, but subversion won't even touch the network
> drive.  I've given Apache permissions on both machines to do whatever it
> needs (e.g. a user with permissions on the specified folders, with the
> network drive set to accept it), but that doesn't help.  It also doesn't
> change anything if I map the UNC path to X:\.

Subversion's hook scripts are run in a nearly-empty environment for
security reasons. Try specifying the full path to your svn.exe.

Mapping a drive definitely won't help, because drive mappings are only
for the logged-on user.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org