Colonel Panic
Colonel Panic

Reputation: 137662

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

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.

Upvotes: 16

Views: 42932

Answers (5)

david-333
david-333

Reputation: 1

If you're using P4V open the "Pending" tab and clear all filters (the red X button). Toggle open the filter menu in the same tab, then set your "Workspace" filter to "Current Workspace" in the dropdown menu.

Upvotes: 0

user31468
user31468

Reputation: 19

Make sure your are sending commands on a valid directory (under workspace...)

For example, if your workspace is located in C:\workspace

and you are sending commands from C:\temp

you should use "cd C:\workspace" before "p4 status"

Upvotes: 0

Ferhat Özdogan
Ferhat Özdogan

Reputation: 59

I realised that these errors appear when I have filters active in my sub-windows like "Pending", "Workspaces" and so on. Clear the filters and try switching the workspaces afterwards. This might help.

Upvotes: 0

aflat
aflat

Reputation: 4329

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.

Upvotes: 4

raven
raven

Reputation: 18135

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.

Upvotes: 18

Related Questions