Do chdir to the given path, and set the PWD environment variable for use by P4. It does not look at getcwd() output. Since we're not using the shell, it is necessary to set the PWD environment variable explicitly. Normally, expand the path to force it to be absolute. This ad
(path, is_client_path=False)
| 154 | |
| 155 | |
| 156 | def chdir(path, is_client_path=False): |
| 157 | """Do chdir to the given path, and set the PWD environment variable for use |
| 158 | by P4. It does not look at getcwd() output. Since we're not using the |
| 159 | shell, it is necessary to set the PWD environment variable explicitly. |
| 160 | |
| 161 | Normally, expand the path to force it to be absolute. This addresses |
| 162 | the use of relative path names inside P4 settings, e.g. |
| 163 | P4CONFIG=.p4config. P4 does not simply open the filename as given; it |
| 164 | looks for .p4config using PWD. |
| 165 | |
| 166 | If is_client_path, the path was handed to us directly by p4, and may be |
| 167 | a symbolic link. Do not call os.getcwd() in this case, because it will |
| 168 | cause p4 to think that PWD is not inside the client path. |
| 169 | """ |
| 170 | |
| 171 | os.chdir(path) |
| 172 | if not is_client_path: |
| 173 | path = os.getcwd() |
| 174 | os.environ['PWD'] = path |
| 175 | |
| 176 | |
| 177 | def calcDiskFree(): |
no outgoing calls