Open SimpsonGSD opened 2 years ago
I suspect this was an issue with how I had p4v configured. In p4v Edit>Preferences I had the application launch set to "Restore all previously opened connections." So when the previous connections were to a different workspace (and sometimes even different server), this resulted in the issue reported above. Altering this setting to "Show connection dialog" allows me to pick the correct server + workspace, and that obviously works. Similarly, altering this setting to "Open the connection specified by your Perforce environment settings" also works - automatically opening to the correct server + workspace.
To fix this when Use Environment is selected you would probably need to extract the necessary p4 environment parameters to pass -p, -u and -c to your p4v call, which would then presumably override the setting in p4v.
Hmm I would have thought that would only affect P4V (I could be wrong). Checkout commands, etc, use p4.exe and invokes the process from the working directory of the file that's being checked out. As long as p4config file is in that directory of one of the parent directories it should pick up the correct env vars.
Did you test checkout? Where is your p4 config file located relative to the file being checked out?
It's just the "Open in Perforce" command (which runs p4v.exe) that is affected by this. Sorry if that wasn't clear. Everything else works fine.
Ok that's good to know. I've updated the title to reflect it's for that command only.
One option is to use p4 set
and get the variables to pass to P4V, as long as p4 set
does not query the server and is a local operation only.
It's being reported that even though Use Environment is selected in one solution it is not using the .p4config file to get the correct P4 environment.
Originally posted by @Malrog in https://github.com/SimpsonGSD/P4EditVS/issues/21#issuecomment-1054410103