Liviu Gelea
Liviu Gelea

Reputation: 361

win apache svn post-commit update hangs

I'm using a svn apache module to manage my repos on a webserver and tartoise svn for interacting with it.

I wanted to automate updating the working copy on the server whenever I commit something so that I don't have to manualy remote desktop on the server and run update manualy.

For that I created a simple post-commit hook on the repo

echo %username% >> C:\debug.txt
svn update F:\wampserver64\www\netcity\maintenance\ >> C:\debug.txt

THe problem is that i can no longer commit any changes to the repo. Commit just hangs after reaching 100% and the ok button is grayed out. Afterwards the commited files are in a locked state i both the client and server and I have to cleanup and update manualy on both stations. The echo %username% is for debugging purposes. I suspect it might be a permission problem so i eched the username svn runs as. This is the output:

XIBM$ 
Updating 'F:\wampserver64\www\netcity\maintenance':

XIBM$ is not even a username. it's the name of the server. If run manualy, the .bat hook runs ok and returns a reaonable output:

liviu.gelea 
Updating 'F:\wampserver64\www\netcity\maintenance':
At revision 19.

I've tried setting full permissions for XIBM/users, authentificated users, administrator, guests and virtually everything that moves on the server but with no luck. so any help is highly apreciated.

Upvotes: 1

Views: 604

Answers (2)

David W.
David W.

Reputation: 107080

As I mentioned many times, don't do this with a post-commit script. While that post-commit script is running, the user is locked out and is waiting for that commit to complete. During this time, they get angry with their computer, Subversion, and you.

Instead, use a continuous integration engine like Jenkins to handle this. Jenkins is simple to setup, and will take away the pain of the post-commit script.

Plus, Jenkins can keep a complete history of all commits, and what happened to the update to the server, and can email you if something goes wrong. Even better, you could use something like the Promote Build plugin to pick and choose which commits you really want to deploy to a server.

Upvotes: 2

thekbb
thekbb

Reputation: 7924

What account is svn running as? I'd recommend a few things

  1. specify the --username in the update, you likely don't want to add the local service account that svn is running as to have access to the repo
  2. add the --accept theirs-full to always take the server copy in the event of conflict
  3. once you get dialed in you'll likely want --quiet as well

Upvotes: 1

Related Questions