Subversion display custom message to client upon update
Let an svn repository be shared among many users. let the svn repository be used to 开发者_StackOverflow社区store versions of a database creation script and some other non-code objects. is there a way to display a custom message (ie:that can be read from a file) upon update?
example: i am working on $project i change the class encapsulating database queries so that i am also adding a single attribute in a database table -> i need to change the test-database creation script so that it contains the new value i modify the file post-update-msg (called, i suppose, by the post-update svn hook) by writing in it:WARNING: the some_db_script changed, you need to generate the test db again
and each client, upon performing an
svn update
command, gets something like:
user@box:~/code/svn-working-copy$ svn update
U many other stuff U scripts/some_db_script Updated to revision n+1 WARNING: the some_db_script changed, you need to generate the test db again user@box:~/code/svn-working-copy$
can it be done via svn hooks? is there another more elegant/better way of doing it?
thanks in advanceIn subversion only terms it is not possible, because subversion provides no post-update-hooks
So you will rely on 3rd party tools(maybe your own checkout script?) which should examine the updated files and will display such a message.
I want to point out, that TortoiseSVN supports such post-update hooks (see instructions here), however you are directly dependent on TortoiseSVN (not so bad, if you ask me) but cannot incorporate other subversion clients(commandline, or IDE-based tools). Also You need to "deploy" these client hooks (as the name said) on each client.
To my knowledge what you are asking for cannot be accomplished the way you are expecting. As a workaround you can validate the dB schema changes during commits and set a custom property (say svn:isdbchanged) which will hold revision in which the db schema changed. Later during build probably you can display the property from your build script after validating if the last build was performed before the particular revision was updated.
精彩评论