Question

We have a pretty standard development process: On a new feature request/bugfix our developers create an own SVN branch develop the code there, we do several code review iterations, code review changes are committed again and when all developers decide that ok, we like the code it is merged back into SVN trunk.

Now a request from a level above use came into the system: We should merge back to trunk only if it was approved by higher m@n@g€m€nt. And they effectively require that we block "svn merge" till someone somewhere presses a button, which sets a flag somewhere ...

Is this even possible? if yes, how?

Was it helpful?

Solution

If your commits into trunk are only mergesets, you can use pre-commit hook, which

  • Intercepts commits to /trunk
  • Check some property of some file or (maybe even /trunk), defined in this commit (originally property have to be defined in branch-root and appear as property of trunk on merge in WC)
  • Allow this commit only if property defined defined and has a predefined value

If your commits are mixed (direct development in trunk and merges), you can slightly expand the above hook and check two svn-properies, where one (and only one) must be defined.

Something like "direct-commit YES" and "merge-approved YES". For development commits merge-approved must not exist, while direct-commit will be defined, for mergesets the situation is reversed (direct-commit doesn't exist, merge-approved is defined)

I see only one problem for administration and management side: on creating branch all these properties must be wiped in branch, "signing" branches for approving merge must happen in secure way (ordinary propset will be exploited soon)

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