Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN post-commit - permission denied to .svn/lock

After commiting, I get a post-commit hook failed error:

svn: Can't open file '.svn/lock': Permission denied

Oddly, my post-commit hook file runs perfectly fine on it's own, just not when called from an actual commit.

Now, the post-commit file ends up svn updateing another working copy, so I assume the error is in this working copy.

When I go into .svn on this working copy, there is no locks file/directory. This is presumably why the script fails.

This is my post-commit file:

#!/bin/sh

REPOS="$1"
REV="$2"

cd /var/www
/usr/bin/svn update

How can I fix the problem?

like image 529
ACarter Avatar asked Jun 24 '13 18:06

ACarter


People also ask

How to unlock a locked file in svn?

Unlock a file in your working copy that is currently locked by another user: $ svn unlock tree. jpg svn: E195013: 'tree. jpg' is not locked in this working copy $ svn unlock --force tree.


2 Answers

my post-commit hook file runs perfectly fine on it's own, just not when called from an actual commit.

My crystal ball tells me your svn hooks are ran by a different user, that doesn't have write rights to the folder it needs to create the lock in.

like image 106
Bartek Banachewicz Avatar answered Sep 18 '22 17:09

Bartek Banachewicz


Seems like you have problem with the permissions may be. Try,

sudo chown -R $(id -u):$(id -g) YourDirectory
sudo chmod -R u+w YourDirectory
like image 27
deepak.prathapani Avatar answered Sep 19 '22 17:09

deepak.prathapani