Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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":

  • DB1.xxx, A_DB1.xxx, B_DB1.xxx
  • DB2.xxx, A_DB2.xxx, B_DB2.xxx

If DB1.xxx is checked out (locked), A_DB1.xxx and B_DB1.xxx 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

1 Answer 1

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

 
discard

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.