0

We have team of 125+ people and we are using tortoise SVN for version control. we have one excel sheet where every user have to update their daily work by end of the day but thing is that no body is updating (SVN update) excel file before making their changes and due to that person who had added his details went missing. so to avoid this i want one svn post commit script which force svn update command to everyone's working copy so whenever they open their working copy it will be up to date. please help me to apply this to my repository we are using tortoise svn with windows clients and we had integrated tortoise svn with collabnet team-forge

2 Answers 2

1

No, you don't want that. This could obliterate work in progress. And it won't help if multiple people try to edit at the same time.

What you want, is a way to tell users "someone else is editing this file now, don't touch it".

The way to do this is to set the svn:needs-lock property on any binary files, such as Excel spreadsheets.

With this property, the file becomes read-only on everybody's working copy. To edit the file, you first use svn lock which makes the file writeable, and prevents anyone else from locking or committing the file. Then, when your changes are done, and you commit, the lock goes away and others can get lock and make changes.

Getting a lock will fail, if your version of the file is out of date, forcing an update.

But be careful not to have the file open when you do an update, or you may write over the incoming changes.

Sign up to request clarification or add additional context in comments.

1 Comment

As an aside, consider that you may be using the wrong tool for the job. This seems more like a job for a collaborative editing tool like Google Docs or whatever Microsoft's answer to that is.
1
  1. As noted You selected the wrong way
  2. You selected the wrong tool: Excel-sheets are not text-files for SVN and thus - they can't be merged nicely (if not merged at all)
  3. You fight with miracles: if all users modify the same file, only fastest will win and can commit file: all other will get "resource outdated" on commit-attempt, have to update own WC and foreign changes will be merged into locally changed file (but see the above warning)

At last - server-side hooks can't do nothing on client's workspaces in common (svn up is client's job, not server), except some exotic cases (ssh CLIENT && cd WC && svn up), which aren't your case

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.