views:

315

answers:

3

Hello all,

I have a developer tool that modifies the local file system using php. These projects are often checked out from SVN. The issue that I would like to avoid is the moving / deleting / renaming of version controlled directoires - and the breakage that occurs to a checked out SVN when doing those alterations locally.

Is there a simple way to apply the SVN commands (move add, delete, rename etc) when I also perform the matching file system operations?

Or is it easier just to delete .svn dirs if found in move / rename targets?

To clarify this:

A checked out svn that has a structure of:

somedir/
--foo/
--cheese/

User 1 alters this file system structure (using the dev tool), renaming the 'foo' dir (which is under version control) to 'modified', when they go to commit their changes the svn will error due to the change in name not being done via SVN commands.

This could be running on a variety of development servers (usually desktop machines running apache on win or mac)

Dont want to ignore or disconnect from the svn.

+1  A: 

Programmatically you may be better off just removing .svn folders. It probably is just one or two lines of code.

Another thing to try, why dont you export the module? that way you dont get .svn folders.

Also note that you can script all svn commands and run them.

omermuhammed
A: 

If I understood correctly, you have one version controlled directory (slave) within another (master). Why not just add slave directory to master svn ignore list?

svn propset svn:ignore slave .
svn ci . -m 'Added ignore dir'

From now on running svn up/add/delete in master directory won't mess up slave svn, while the latter remaining fully functional.

Michał Rudnicki
+1  A: 

In your PHP file, you could use the svn commands via exec()

<?php
$Output = '';
$ExitCode = 0;
exec('svn mv "'.$Current.'" "'.$New.'"', $Output, $ExitCode);

$Output is the output of the command and $ExitCode will be 0 if the command was successful.

Keep in mind however, that for security reasons the exec() command might be disabled on some systems. If you have control of your php.ini file, you can choose to enable/disable it.

sirlancelot
I'll have a look into running commands on our local machines thanks for that
Andy Johnston
There is also an svn-extension in pecl, which you can use.
troelskn