Merge branch 'master' of git.labs.intellij.net:idea/community
authorKirill Likhodedov <kirill.likhodedov@jetbrains.com>
Fri, 1 Oct 2010 13:26:03 +0000 (17:26 +0400)
committerKirill Likhodedov <kirill.likhodedov@jetbrains.com>
Fri, 1 Oct 2010 13:26:03 +0000 (17:26 +0400)
1  2 
platform/testFramework/src/com/intellij/testFramework/AbstractVcsTestCase.java

index 54a01787c797429a629d008616871304eddf23a9,a6ce605be9a4a153b71e7188b74ad9894350b663..1388f95c8d63d15d7a3abfc2b38176fed3fd4863
@@@ -189,12 -184,10 +191,13 @@@ public class AbstractVcsTestCase 
    protected VirtualFile createDirInCommand(final VirtualFile parent, final String name) {
      final Ref<VirtualFile> result = new Ref<VirtualFile>();
      new WriteCommandAction.Simple(myProject) {
+       @Override
        protected void run() throws Throwable {
          try {
 -          VirtualFile dir = parent.createChildDirectory(this, name);
 +          VirtualFile dir = parent.findChild(name);
 +          if (dir == null) {
 +            dir = parent.createChildDirectory(this, name);
 +          }
            result.set(dir);
          }
          catch (IOException e) {
      }.execute();
    }
  
 +  protected void editFileInCommand(final VirtualFile file, final String newContent) {
 +    editFileInCommand(myProject, file, newContent);
 +  }
 +
    public static void editFileInCommand(final Project project, final VirtualFile file, final String newContent) {
      new WriteCommandAction.Simple(project) {
+       @Override
        protected void run() throws Throwable {
          try {
            file.setBinaryContent(newContent.getBytes());