Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

p4 status "Path is not under client's root"

Tags:

perforce

I have two Perforce workspaces on my computer, one at c:\dev and second at c:\code . When I run p4 status in c:\code I get an error message

Path 'c:\code\...' is not under client's root 'c:\dev'

The same happens for p4 reconcile. How can I get the commands to work? It's obvious it's trying to run the command against the wrong repo.

like image 284
Colonel Panic Avatar asked Jun 16 '14 13:06

Colonel Panic


2 Answers

If you don't explicitly set the P4CLIENT environment variable, Perforce uses the default workspace. How it decides which workspace is the default, I do not know. Anyway, it has defaulted to the one whose root you have mapped to C:\dev. You need to switch to workspace code (or whatever its actual name is). At the command line type the following command to switch workspaces:

p4 set P4CLIENT=[client name]

Of course, you'll replace "[client name]" with the name of the workspace whose root you have mapped to C:\code.

like image 83
raven Avatar answered Nov 01 '22 04:11

raven


Expanding a bit on raven's answer. By default, if you don't set P4CLIENT, perforce takes your machine name as the default client name. So if you want to use another client, you have to use the p4 set P4CLIENT=[client name], which will set it for every instance of p4 you run, no matter which command window you are in. You can can also do a set P4CLIENT=[client name] on the command line, which will only be valid in the command window that you are running in.

In addition, you can use p4 -c [client_name] <command> since -c is a global option, you can supply it to all p4 commands.

like image 45
aflat Avatar answered Nov 01 '22 06:11

aflat