0

I am not able to access my https svn server using my local post commit hook. How to find the hook path in the https svn server https://**/svn/myProject/trunk

Sweety Bertilla
  • 972
  • 10
  • 35
  • Do you have an admin that set up the server? Talk with them first. – crashmstr Feb 14 '14 at 21:04
  • I am able to connect from cornerstone to access it. But I am not sure how to check for the hooks – Sweety Bertilla Feb 14 '14 at 21:09
  • If this is a server your company owns/controls, talk to whoever set up the server. If it is an outside hosted repository, contact the hosting company. Depending on the configuration, it could be very different. – crashmstr Feb 14 '14 at 21:18
  • Can I not directly use the path "https://**/svn/myProject/trunk"??? to find the hook to do post commit hook? – Sweety Bertilla Feb 14 '14 at 21:29
  • No, you need to find where the `myProject` repository is, which depending on the server configuration, could be just about anywhere. Also, in the repository, there is no `trunk` folder, but the repository itself, which then has (or should have) a `hooks` folder. Like I said, ask the person who set up the server or whoever hosts it for you. – crashmstr Feb 14 '14 at 22:40

1 Answers1

1

Subversion hook scripts are stored in the hooks directory of a repository. To learn how it works it's good to create a local repository to play with:

svnadmin create /tmp/testrepo

All hooks are disabled by default, if you look inside /tmp/testrepo/hooks you will see a bunch of files with a .tmpl extension, for example post-commit.tmpl. When a hook script is enabled, it should not have such extension, and it should be executable.

From a client, you cannot access to these hook scripts, or check that they exist. You need shell access on the system hosting the repository, in this case the /tmp/testrepo dir.

You can play with hook scripts using this local repository, its URL is file:///tmp/testrepo, for example:

$ svn co file:///tmp/testrepo /tmp/checkout
Checked out revision 0.
$ cd /tmp/checkout/
$ date > date.txt
$ svn add date.txt 
A         date.txt
$ svn ci -m 'first commit'
Adding         date.txt
Transmitting file data .
Committed revision 1.
janos
  • 120,954
  • 29
  • 226
  • 236
  • Can I do the following by using shell access to the server repository: 1. Use the post-commit hook .tmpl to checkout a committed files to the trunk of the svn server. 2. Checkout to another server. example. svn co . 3. another server might be a https server. so, I need to work out this : svn co /svn-server/trunk https://another server path. 4. This checkout should happen each time a file is committed in the trunk of svn server – Sweety Bertilla Feb 17 '14 at 00:29