Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open in P4V command does not use .p4config when Use Environment is selected #22

Open
SimpsonGSD opened this issue Feb 28, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@SimpsonGSD
Copy link
Owner

SimpsonGSD commented Feb 28, 2022

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.

  • I tried a different solution, and it also crashed. Got an error message from perforce in the process:
    Path 'e:\perforce\new_solution\new_file.cpp/...' is not under client's root 'D:\dev\perforce\original_solution'.
    Both solutions have a .p4config set up, and Use Environment is true, so I guess the environment variables are pointing at original_solution or something? Shouldn't it use .p4config though?

Originally posted by @Malrog in #21 (comment)

@SimpsonGSD SimpsonGSD added the bug Something isn't working label Mar 1, 2022
@Malrog
Copy link

Malrog commented Mar 1, 2022

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.

@SimpsonGSD
Copy link
Owner Author

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?

@Malrog
Copy link

Malrog commented Mar 1, 2022

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.

@SimpsonGSD SimpsonGSD changed the title .p4config not working as intended when Use Environment is selected Open in P4V command does not use .p4config when Use Environment is selected Mar 1, 2022
@SimpsonGSD
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants