Perforce troubles “file not under client's root” error message

孤街醉人 提交于 2020-01-02 01:03:12

问题


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/...

回答1:


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".




回答2:


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.




回答3:


One 'oops' mistake you can make is to have the wrong workspace selected in Visual Studio 2012. Just did that and spent a few minutes scratching my head.




回答4:


I'd guess that Perforce is having problems with the spaces in your path. Try putting quotes around it.

From http://www.perforce.com/perforce/doc.current/manuals/p4guide/03_using.html:

Spaces in filenames, pathnames, and identifiers Use quotation marks to enclose files or directories that contain spaces. For example: "//depot/dev/main/docs/manuals/recommended configuration.doc" If you specify spaces in names for other Perforce objects, such as branch names, client names, label names, and so on, the spaces are automatically converted to underscores by the Perforce server.




回答5:


I had similar error message showing during project build. What helped was deleting .suo file and reloading the project as described in How does Visual Studio's source control integration work with Perforce?




回答6:


Check the path specified in the client Root. If this is not a valid path then you encounter this error

Root:   /a/b/c/d

If this is not a valid root you end up getting the following error

Path '/a/b/c/d/...' is not under client's root '/a/b/c/d'

Just correct the path pointed to by Root and you should be fine




回答7:


This exact problem was related to my "PENDING VIEW". It had a search filter set for the default workspace at the time, and any time I switched to a different workspace it would show the error dialog.

The deal was I had changed the workspace name, and the filter was no longer valid.

I cleared the filter (in the pending view) and the error disappeared.



来源:https://stackoverflow.com/questions/12428521/perforce-troubles-file-not-under-clients-root-error-message

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!