So over the last week I have been working on and off with a PHP frontend to SVN. The frontend needed to be designed in such a way that each developer could access their working copies and make the full range of actions against them. I decided to also use an AJAX setup so that pages would be quickly loaded and updated by a single toggle of a folder. The first issue that I had to deal with was when a SVN command was issues it needed to be issued as the owner of the code so that SVN could track edits correctly. After googling around for a bit I quickly realized that there was not a viable Apache MPM that would serve virtual hosts under different users and groups. Then the light bulb flipped on, setup a proxy and redirect requests to developer.dev.domain.com to its own instance of apache running as the user and group ‘developer’. This would ensure that all SVN commands would run as ‘developer’ when executed. I then moved onto setting up the interface. The features that are working at this time are:
- create working copy from repository (svn checkout)
- delete working copy
- svn add
- svn blame
- svn commit
- svn copy
- svn delete
- svn diff
- svn move
- svn propset
- search files (via a grep/find combination, omitting .svn folders)
- svn log
- svn rename
- svn status
- update local working copy
- update stage environment
- publish stage environment
A few things that I learned while working with doing the SVN commands was that when executing a command via the php function exec() I need to add the flag –config-dir=$USER_HOME_DIR/.subversion (or where ever the users .subversion folder is located). Also if a command does not seem to be executing correctly you can add “2>&1″ without quotations to the command being run and it will return any error messages through the $ouput variable for exec();
9 responses
Do you want to comment?
Comments RSS and TrackBack Identifier URI ?
Trackbacks