Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perforce troubles "file not under client's root" error message

I am adding a project to perforce via VS2010 but I keep getting this error 'file' not under client's root for all the files in the project. I can't seem to figure this out.

Here is what I am doing:

1) Open VS2010 project which is not in perforce yet.

2) I select add the solotion to perforce (from File > Source Control > Add Solution menu).

3) I select a new workspace. It brings up the properties of the workspace. The root folder is default to c:\Users\My.Name. I change this to the folder where my project is. I also change the view so it points to say depot\main\new_project.

It seems to have added the project but when I checkin file it just doesn't work! It give this error for all files that 'file not under client's root'.

I also go to perforce directly and check the settings of the corresponding workspace. In dashboard it display an error:

P4V is having trouble translating the location "c:\Users\user.Name\Documents\Code\My_Project" to a valid workspace location. To filter using this location, drag the folder from the workspace tree to the workspace folder field or include the depot location in your workspace view.

Can somebody give me any pointer why this just doesn't work?

Update My workspace mapping is this

Client:  omega
Owner:   User.Name
Root:    C:\Users\User.Name\Documents\Visual Studio 2010\Projects\Omega
LineEnd: local
View:
         //depot/main/omega/...     //omega/...
like image 540
zar Avatar asked Sep 14 '12 16:09

zar


2 Answers

If you get this error while the "Pending" Tab is open, the following could be your problem! You may not be seeing your entire filter (ie. some of the filter may be out of view). Mouse over your Window Pane Border underneath the filter until your cursor changes so that you can expand the Filter Window Pane. There is a filter that could be there that says, "Files that match any of the following file paths:" Make sure that you don't have a file path selected that is incorrect. Either remove the filter or choose "Current depor or workspace tree selection".

like image 143
Cari Avatar answered Oct 29 '22 21:10

Cari


What I believe is that you have a different path for your client and your code is in different path. From you P4V error I see that the path is:

c:\Users\user.Name\Documents\Code\My_Project

But your client root path is:

C:\Users\User.Name\Documents\Visual Studio 2010\Projects\Omega

In above scenario, the path only upto "C:\Users\User.Name\Documents" is common, after that your client root and your project root differs. If you want to check in code from your My_Project folder, change the client root to point to that. You can do so on command line by

p4 client <client name>

Or change it in Workspace view of P4V.

Also, make sure to use "" around your path since it has folder name with space.

Hope this helps.

like image 31
Raghuveer Avatar answered Oct 29 '22 22:10

Raghuveer