Question

i will replace automatically informations while SVN-Commitment.

For example:

myfile.js

/* $Author:User; $ChangeDate:02.01.2014; $Revision:10401; */
function myJavascriptFile(){
}

Now when the commitment is runnig the hook should replace the information.

$Author:theAuthorname; ...            

Couldn't find something about that... is this possible with hooks and when 'yes' - how?

thanks for help and happy new year!

Was it helpful?

Solution

Hook scripts should never attempt to modify the contents of your transaction. You could:

  • Break the commit process entirely
  • Find yourself in a race condition
  • Slow down everyone while they wait for the hook to complete
  • Break the code that the user is attempting to commit (code that compiled for the developer suddenly doesn't compile when checked out)
  • (Best-case scenario) what the user thinks they just committed isn't what actually went into the repository and they are forced to run svn update after every commit just to see what's really in the repository.

It's unclear what you're trying to achieve here with this replacement. If svn:keywords isn't providing the information or format that you need, don't use it and instead use a different method to achieve your desired state.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top