|
@@ -255,11 +255,15 @@ class FileTree extends FileView {
|
|
|
if( isDir && !ide.confirm("Renaming a SVN directory, but 'svn' system command was not found. Continue ?") )
|
|
|
return false;
|
|
|
} else {
|
|
|
- // Check if file is versioned before using svn rename
|
|
|
- if (js.node.ChildProcess.spawnSync("svn",["info", ide.getPath(path)]).status == 0) {
|
|
|
+ // Check if origin file and target directory are versioned
|
|
|
+ var isFileVersioned = js.node.ChildProcess.spawnSync("svn",["info", ide.getPath(path)]).status == 0;
|
|
|
+ var newAbsPath = ide.getPath(newPath);
|
|
|
+ var parentFolder = newAbsPath.substring(0, newAbsPath.lastIndexOf('/'));
|
|
|
+ var isDirVersioned = js.node.ChildProcess.spawnSync("svn",["info", parentFolder]).status == 0;
|
|
|
+ if (isFileVersioned && isDirVersioned) {
|
|
|
var cwd = Sys.getCwd();
|
|
|
Sys.setCwd(ide.resourceDir);
|
|
|
- var code = Sys.command("svn",["rename",path,newPath]);
|
|
|
+ var code = Sys.command("svn",["rename", path, newPath]);
|
|
|
Sys.setCwd(cwd);
|
|
|
if( code == 0 )
|
|
|
wasRenamed = true;
|