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

Re: svnadmin

From: Ryan Schmidt <subversion-2012c_at_ryandesign.com>
Date: Mon, 10 Sep 2012 10:38:40 -0500

On Sep 10, 2012, at 08:49, John Maher wrote:

> I read that link you posted but now I am confused about hooks. I see
> the hook directory get created when I create a repository locally.

The only way to create a repository is locally, using the "svnadmin create" command (or using some sort of GUI that someone has written on top of svnadmin). If you want to create a repository on a server, make yourself be local to the server (using ssh or screen sharing or similar) and create it there. Or find a web-based Subversion administrative GUI and install that on your server; I'm given to understand that Subversion Edge contains such a web GUI. All repositories created using "svnadmin create" will contain all the required directories, including the "hooks" directory.

$ svnadmin create foo
$ find foo -type d
foo
foo/conf
foo/db
foo/db/revprops
foo/db/revprops/0
foo/db/revs
foo/db/revs/0
foo/db/transactions
foo/db/txn-protorevs
foo/hooks
foo/locks
$

The filesystem inside the repository starts out empty, of course, for you to fill with your data as desired.

> But
> there isn't any such directory in the repository created on a server
> (VisualSVN).

I don't know what you mean by this. I'm also not familiar with VisualSVN. How did you verify that the repository on the server does not contain the hooks directory? You should be able to ssh or screenshare to the server and verify that its local filesystem has a hooks (and conf and db and locks) directory in the repository's directory.

Perhaps you're not seeing the distinction between the repository directory on the server's hard drive (which contains those directories I listed above), and what you see when you look into a repository using commands like "svn ls" or "svn checkout" (which will show whatever it is you have stored in your repository)?

> I searched through the book using the keyword "hooks" and
> couldn't find any clue.
>
> 1) Can hooks be used on a non-local repository?

The question is strange. Hook scripts run on the server. Doesn't matter whether the client accessing that server is running on the same computer as the server or on a computer halfway around the world. Users can perform actions on the repository from anywhere, and if the server has hook scripts set up for any of those actions, it will run those scripts locally on the server at the appropriate times.

> 2) I read somewhere that a directory repository structure is not
> recommended for multi-user environments. Is this true?

I'm not sure what you mean. What is a directory repository structure?

If you want to serve a collection of repositories from the same server with minimum configuration fuss, then all repositories should exist in a single directory on the server, not nested inside other subdirectories.

That is to say, your directory structure on the server should look like:

/path/to/svn/repo1
/path/to/svn/repo2
/path/to/svn/repo3

Not:

/path/to/svn/repo1
/path/to/svn/foo/bar/repo2
/path/to/svn/baz/repo3

> 3) If #2 is true then is it also true that "svnadmin create" is for
> single users ONLY?

"svnadmin create" is the only command that exists for creating repositories, therefore it is the correct command to use regardless of how those repositories will be used.
Received on 2012-09-10 17:39:22 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.