Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

svn sync with perlscript

by karthik.raju (Acolyte)
on Jun 02, 2015 at 11:16 UTC ( [id://1128745]=perlquestion: print w/replies, xml ) Need Help??

karthik.raju has asked for the wisdom of the Perl Monks concerning the following question:

Hi All, In one of my project, we need to automate the svnsync process between two repositories through Perl script.

And when we run the perl script with the following code then it is working fine.

system('svnsync sync https://xxxxxx64.xxx-xxx.com/svn/repo2/');

But when we are trying to call the same script from pre-commit.bat hook it is not working,

can any one help on this.

Thanks in advance.

-Karthik

Replies are listed 'Best First'.
Re: svn sync with perlscript
by MidLifeXis (Monsignor) on Jun 02, 2015 at 12:10 UTC

    Please define "not working". Is it complaining that this action will start a warp core breach? Include the error messages within <code>...</code>.

    If I were to guess, I would look to see if you are running with the same environment in both locations. Hooks running under the control of another process can have a much different environment than the user does at their shell level.

    --MidLifeXis

Re: svn sync with perlscript
by stevieb (Canon) on Jun 02, 2015 at 14:27 UTC

    I'm assuming this is Windows, but that doesn't really matter. Try putting the whole path to svnsync in the system call... eg: "c:\program files\svn\svnsync" or whatever it may be.

    After that, try the pre-commit again.

    This is a common issue on Unix when running a script from the scheduler... runs fine on the CLI, but the environment isn't set up the same when running it from cron.

    -stevieb

Re: svn sync with perlscript
by locked_user sundialsvc4 (Abbot) on Jun 02, 2015 at 11:28 UTC

    What is the message that is displayed?

    I suspect that, at the point this hook will be running, you cannot issue a svnsync command because, well, “that would run the hook.”   The pre-commit process is already begun.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1128745]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (1)
As of 2026-03-08 20:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.