Merge branch 'master' into nz/shared_shelf
authorVladimir Krivosheev <vladimir.krivosheev@jetbrains.com>
Tue, 14 Jul 2015 16:34:59 +0000 (18:34 +0200)
committerVladimir Krivosheev <vladimir.krivosheev@jetbrains.com>
Tue, 14 Jul 2015 16:34:59 +0000 (18:34 +0200)
# Conflicts:
# platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelveChangesManager.java

1  2 
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelveChangesManager.java

index 253b623a4f77bdbf852de3c1eb16b2fd4b52d919,5de3f17a5fbbac95ea03d88e368c5e45df587656..0614020b86e2cc330032e592a60f205d815fe6f8
@@@ -27,9 -28,6 +28,7 @@@ import com.intellij.openapi.application
  import com.intellij.openapi.application.PathManager;
  import com.intellij.openapi.application.impl.LaterInvocator;
  import com.intellij.openapi.components.AbstractProjectComponent;
- import com.intellij.openapi.components.RoamingType;
- import com.intellij.openapi.components.StoragePathMacros;
 +import com.intellij.openapi.components.StorageScheme;
  import com.intellij.openapi.diagnostic.Logger;
  import com.intellij.openapi.diff.impl.patch.*;
  import com.intellij.openapi.diff.impl.patch.apply.ApplyFilePatchBase;
@@@ -42,10 -37,9 +41,9 @@@ import com.intellij.openapi.progress.As
  import com.intellij.openapi.progress.ProgressIndicator;
  import com.intellij.openapi.progress.ProgressManager;
  import com.intellij.openapi.project.Project;
- import com.intellij.openapi.project.ex.ProjectEx;
  import com.intellij.openapi.util.*;
  import com.intellij.openapi.util.io.FileUtil;
 -import com.intellij.openapi.util.io.FileUtilRt;
 +import com.intellij.openapi.util.text.StringUtil;
  import com.intellij.openapi.vcs.*;
  import com.intellij.openapi.vcs.changes.*;
  import com.intellij.openapi.vcs.changes.patch.ApplyPatchDefaultExecutor;
@@@ -123,23 -93,14 +121,28 @@@ public class ShelveChangesManager exten
      if (project.isDefault()) {
        myFileProcessor = new CompoundShelfFileProcessor(null, PathManager.getConfigPath() + File.separator + SHELF_DIR_NAME);
      }
+     else if (ProjectUtil.isDirectoryBased(project)) {
+       VirtualFile dir = project.getBaseDir();
+       String shelfBaseDirPath = dir == null ? "" : dir.getPath() + File.separator + Project.DIRECTORY_STORE_FOLDER;
+       myFileProcessor = new CompoundShelfFileProcessor(shelfBaseDirPath);
+     }
      else {
 -      myFileProcessor = new CompoundShelfFileProcessor();
 +      if (project instanceof ProjectEx && ((ProjectEx)project).getStateStore().getStorageScheme() == StorageScheme.DIRECTORY_BASED) {
 +        myFileProcessor = new CompoundShelfFileProcessor(mySchemesManager.getRootDirectory().getPath());
 +      }
 +      else {
 +        myFileProcessor = new CompoundShelfFileProcessor();
 +      }
      }
 +
 +    mySchemesManager.loadSchemes();
 +  }
 +
 +  @NotNull
 +  private ShelvedChangeList readOneShelvedChangeList(@NotNull Element element) throws InvalidDataException {
 +    ShelvedChangeList data = new ShelvedChangeList();
 +    data.readExternal(element);
 +    return data;
    }
  
    @Override