Hook into commit to create a version text file?

Tom Knowlton
Tom Knowlton used Ask the Experts™
on
Thanks to the kind folks here on EE, I am now able to run the following from a command prompt:

C:\>svnversion.exe -n MasterDev_SVN > MasterDev_SVN\MasterDev\Website\Campus~1\v
er.txt

and it will create a text file with information on what revision I am on:

1:36M

(as an example)



My question now becomes...how can I make the creation of this file automatic when I do a SVN Commit?


I recently did something like this where SVN would not allow me to edit an existing log file and I created a batch file to override that restriction.

I imagine the same thing applies here....I just need some guidance....detailed guidance please.  :)   :P
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
You do not want to execute it on commit. You do not need the file in a repository. You need to create a file only for a copy running on a web server. Create it there every time after you update it.

What do you do to update the web server?
Tom KnowltonWeb developer

Author

Commented:
I am very confused.

>>>>You do not want to execute it on commit.

Why?

>>>>You do not need the file in a repository.

Why don't I?

>>>>You need to create a file only for a copy running on a web server. Create it there every time after you update it.

I only have SVN on my local machine.  That is where I do my commits.



>>>What do you do to update the web server?


I create a remote connection to the web server and then copy the files from my development machine  up to the web server.
>>>>You do not want to execute it on commit.

Before a commit it would generate not the revision number you want. If you execute it after a commit, you would need another one to save it to a SVN repository.

>>>>You do not need the file in a repository.

because SVN has got this information anyway.

"I create a remote connection to the web server and then copy the files from my development machine  up to the web server."

Then create a batch file to copy the files and add executing svnversion at the end.
Tom KnowltonWeb developer

Author

Commented:
>>>>Then create a batch file to copy the files and add executing svnversion at the end.

I've been considering this for a while....perhaps it is time to go ahead and do it.


Thank you for the recommendations!!

Tom
Tom KnowltonWeb developer

Author

Commented:
thx

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial