1
votes

I'm trying to understand how perorce work and I'm struggling with command line I have a single depot with 3 project inside so depot:

  • projectA
  • projectB

now I have 2 workspaces, one mapped only on projectA and one on projectB.

Here I have my trouble , using interface everything works but with command line I have not enough knoledge on perforce. I use p4 -c workspacA //to switch workspace

then I run: p4 cstat

and it give me all the information about changelist contained in all depot not only depot/projectA

But I woul like to enter in a workspace and run my command only on that workspace

Is this normal? I see that I need to specify my depot mapping but this seems strange to me. Can someone clarify me this? Thanks

1

1 Answers

3
votes

Do:

p4 set P4CLIENT=workspaceA

If you use -c workspaceA it applies only to that one command, whereas p4 set is persistent.

I also recommend looking at documentation on P4CONFIG, which lets you associate Perforce config settings with local directories (so you switch workspaces automatically when you cd to a different workspace root).

https://www.perforce.com/manuals/v16.2/cmdref/P4CONFIG.html