Index: src/org/jetbrains/idea/perforce/perforce/connections/P4CommandLineConnection.java
===================================================================
--- src/org/jetbrains/idea/perforce/perforce/connections/P4CommandLineConnection.java	(revision 10555)
+++ src/org/jetbrains/idea/perforce/perforce/connections/P4CommandLineConnection.java	(working copy)
@@ -95,7 +95,14 @@
     }
 
     final Runtime rt = Runtime.getRuntime();
-    final Process proc = rt.exec(cmd, EnvironmentUtil.getEnvironment(), cwd);
+    String[] env = EnvironmentUtil.getEnvironment();
+
+    // On Unix, Perforce relies on the "PWD" variable to determine its current working directory
+    // for finding .p4config.  We need to make sure it matches the directory we want to use.
+    // (JetBrains bugs: IDEADEV-7445, etc.)
+    setEnvironmentVariable(env, "PWD", cwd.getAbsolutePath());
+
+    final Process proc = rt.exec(cmd, env, cwd);
     if (inputData != null) {
       OutputStream outputStream = proc.getOutputStream();
       try {
@@ -156,4 +163,13 @@
       throw new PerforceTimeoutException();
     }
   }
+
+  private static void setEnvironmentVariable(String[] env, String name, String newValue) {
+    for (int i = 0; i < env.length; i++) {
+      String var = env[i];
+      if (var.startsWith(name + "=")) {
+        env[i] = name + "=" + newValue;
+      }
+    }
+  }
 }
