I have a revision.txt file in my SVN project.
Basically I want that this file is updated automatically when I call svn ci with the revision number the working copy will have after the commit.
For example:
I've tried without success with an hook script. I cannot retrieve the next revision number and update the transactione before committing.
Then try with "auto-props", but they are working only with modified files. The preferable solution is using only hook script and not using a wrapper script which check the revision and update.
Is possible ? Examples are welcome
You can't guess the next revision number before commit due to race conditions - you can't guarantee, until after the fact, that someone else hasn't got in ahead of you. It's also extremely bad form to change files in a svn commit hook - working copies get all out of date and messy, as they only get a "it worked" or "it failed" from the server, never a "it worked, but by the way that file now has these contents ..."
What do you need this for? Perhaps there's another way to get what you're trying to achieve.
You could auto-generate the revision.txt file just before it's needed by using "svn info", and filtering the "Revision: " line into the file.