Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A customer of us wants to introduce locking and versioning of our applications data. We came up with the idea to use subversion/tortoise to do this. This seems simple and pretty straight forward, but we have some special nature based in the nature of our files:

A "database" (we call it a document) in our application consists of a number of files, that refer to each other by a name pattern within the same directory. More that one "database" may exist within a single directory. If a user checks out a (anchor-) file all other files belonging to that database must also be checked out. The same applies to checkin. The files contain binary data.

Example: A directory contains 2 "databases":


If is checked out (locked), and must be locked as well, but the files of DB2 can be checked out by someone else. Then we work on the local copy and afterwards changes may be checked in or canceled by the user.

Is that possible using subversion? How? Should we use something else?

I know that the organization of our files etc. could be done better - but its currently not possible to change that.

share|improve this question

What you are attempting to do should be possible using a subversion pre-commit hook. Inside the hook scrip you can check the to be committed file list and veto the commit (writing a meaningful error message to stderr) if the file set is wrong.

I have not seen anybody publish a hook script to do anything near to this so you will have to roll your own. To get started you should read the subversion book sections on writing and implementing hook scripts and some example hook scripts

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.