I face a few problems when I use svn. Here is a list
- at some point in time, all my commands like svn commit, svn add, etc worked, but I did something so that none of them would work without running them as root user (sudo). what specific actions would cause this, and how to fix it?
- my other website created an images folder itself, and its user:group became www-data:www-data as a result. when i tried to add this folder to versioning, i think svn failed to create a subdirectory .svn inside images, so it outputted that all sub-paths to the image s folder were locked, and i needed to run cleanup. The cleanup also failed. Also it started showing the images directory with a '~' (tilde) implying that it was versioned at some point but something happened to it. I fixed the 'cant commit till break locks'-and-'cant break locks' cyclic problem as follows:
- removed .svn/lock files from each of the directories leading to the images folder
- moved the images directory to home folder, and committed "Deleted images"
- copied back the images folder and did 'svn add'
But I want to know what i should have done in each of the above two cases. i suspect that in case 1, the problem had something to do with messed-up folder permissions, but I dont know exactly what, and how to fix it. I suspect I could take one of the following steps for folders that dont have the appropriate owners/groups set:
- try to do 'sudo add folder_with_different_user_and_group'
- change user:group to default values, add files and commit. But somehow i would want to revert these changes in a way that it will make it work in future. probably change permissions back but dont change owner:group of the .svn folder?
what is the best way to use svn in each of the above cases, and how to successfully break locks etc when something like this happens?