Merge branch 'master' into nz/shared_shelf
[idea/community.git] / platform / vcs-impl / src / com / intellij / openapi / vcs / changes / shelf / ShelveChangesManager.java
index 253b623a4f77bdbf852de3c1eb16b2fd4b52d919..0614020b86e2cc330032e592a60f205d815fe6f8 100644 (file)
  */
 package com.intellij.openapi.vcs.changes.shelf;
 
+import com.intellij.ide.impl.ProjectUtil;
 import com.intellij.lifecycle.PeriodicalTasksCloser;
 import com.intellij.openapi.application.ApplicationManager;
 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.*;
@@ -42,7 +41,6 @@ import com.intellij.openapi.progress.AsynchronousExecution;
 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.text.StringUtil;
@@ -123,6 +121,11 @@ public class ShelveChangesManager extends AbstractProjectComponent implements JD
     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 {
       if (project instanceof ProjectEx && ((ProjectEx)project).getStateStore().getStorageScheme() == StorageScheme.DIRECTORY_BASED) {
         myFileProcessor = new CompoundShelfFileProcessor(mySchemesManager.getRootDirectory().getPath());