Where is Perforce workspace mapping stored? - perforce

Where does Perforce store workspace mapping configuration (in P4V accessible through Menu > Connections > Edit Current Workspace... > tab Basic, related P4V guide)?
Example of workspace mapping:
//depot/... //bruno/depot/...
//user_depot/... //bruno/user_depot/...
//projects/... //bruno/myprojects/...

All of the metadata for each workspace (and everything else) is stored in the server database. (Client views specifically live in the db.view table.)

Related

Helix P4V Server IGNORE file not working with P4V client

I setup a P4V server on my machine successfully and was able to set a P4IGNORE file.
To test this, I added a test.txt file to be ignore on add. When I add a test.txt file to my local repo and mark it for add it isn't ignored and gets pushed to the server. On the other hand when I p4 add -f test.txt it will work and say the file is ignored in the terminal. I have no idea why this is? Thanks.
P4IGNORE is a client setting, not a server setting. Your P4V client might not be configured to read your ignore file.
If you want server-side enforcement of which files go into the server, use either the protection table (which can be applied across all users) or the client view (which will apply any time you use that workspace, regardless of whether you're using p4 or P4V or any other client app).

I cannot remove a workspace form P4V because its relative folder deleted in windows file explorer

I was setting up a small server to allow my friends to access Unreal Engine documents. I am completely new to this. I accidentally made an extra folder. I didn't notice I didn't need it at the time and made it a workspace. Then I realized and deleted it in the window file explorer. However, as I figured out it did not remove it from P4V.
Now, when I try to delete the workspace in P4V, I get the error message:
"Client 'UE4Workspace1' has files opened. To delete the client, revert any opened files and delete any pending changes first. An administrator may specify -f to force the delete of another user's client."
I do not know how to use -f. What can I do?
According to the error message, you have checked out some files in the workspace which you were trying to delete.
So to fix the problem:
1 switch to the workspace you want to delete.
2 revert these files in your pending change list (Or possibly in other changelist in that workspace)
3 delete any numbered changelists in that workspace.
4 switch to other workspace(this step is possibly optional)
5 delete the problemetic workspace in p4v.
I guess P4 maintains status of every workspace in the server. And to avoid mis-deleting local edited files, they will prevent users from deleting workspaces if the workspaces still have pending files.
Assuming you have the correct rights, you can from a command line, while being logged in the server,
p4 client -d -f <workspace_name>
-d : means delete
-f : means force
A client or a workspace in Perforce speak is the same thing. (I am not quite sure why there are two terms for the same thing.)
Full reference : https://www.perforce.com/perforce/r15.2/manuals/cmdref/p4_client.html

How to change the mapped TFS location from team foundation server ?

I mapped a project in TFS in wrong location, after that I did undo pending changes and try to remap the project to correct location.But when try to remap, it automatically mapped to previously mapped location which I gave mistakenly.
So how can I map it to correct location.
Thank you.
When you map a solution to team foundation server, It will automatically create a workspace in your pc, so afterwards that workspace used feature mapping, so you have to remove the that workspace in you workspaces.
Steps -
Go to workspaces.
File - > Source control - > Advanced - > workspaces..
Double click on your current workspaces.
Then find the workspace which you mistakenly added and remove it.
Now you can map to your solution to correct location.

perforce how to cleanup a file opened on a non-existent client and non-existent workspace

Title says it all.
There's a file that perforce thinks it is opened in exclusive mode by a user on a given workspace and a given changelist, but neither the workspace nor the changelist exists. The workspace was force deleted by an admin, the file mysteriously disappeared from the changelist and then we removed all other files from it and deleted it.
File still shows as being opened and locked by that user on that workspace on that changelist.
Most likely corrupted perforce database, possible solution here, as replied on the perforce forums: https://kb.perforce.com/AdminTasks/BackupAndRecovery/RarelyUsedSe..ommandFlags/P4dXxFlag
Do you know how your admin removed the workspace? According to the documentation, deleting a workspace should automatically revert any files, but leave the local files on the file system, which should be straight forward enough to delete.
If the issue is merely that the file remains locked, then a simple:
p4 unlock -f <file>
issued by an administrator, should resolve the problem.
I had this flag setting after moving a depot to a new server, which I don't recommend.
I created the User back on the new system.
I was able to see the old workspace, which was previously hidden because of filters.
Right click on the workspace, choose edit, and under the advanced tab there is a Host field, that I changed to match the current hostname (including the port - newhost:1666).
Set the connection to the user / workspace
Now the check mark was red, instead of blue.
I selected each marked file, right clicked and chose Resolve by the default safe mode. I forget if the icon changed.
Then I right-clicked and chose Revert if Unchanged, and the icon went back to a "file synced" blue dot. Done.
I hope this makes sense.
This sounds like an inconsistency between the server's db.locks and db.working tables -- deleting the workspace must have deleted the db.working entries but not the db.locks entries (they're always supposed to be one-to-one).
From the server side there are a couple of options to fix this:
p4d -xx db.working db.locks
p4d -jr jnl.fix
or:
p4d -xf 925
It's also possible to go through some gyrations to fix it from the client side:
p4 set P4CLIENT=CLIENT_NAME (where this is the name of the deleted workspace)
p4 client
p4 sync FILE_NAME
p4 edit FILE_NAME
p4 revert FILE_NAME
p4 sync #none
p4 client -d CLIENT_NAME
i.e. re-create the opened file state (same depot file and same client name, so that the keys will match), and then revert it so the entries can get cleaned up properly.

Issue while creating workspace in perforce

I am not able to create a workspace in perforce. I go to Connection --> New Workspace and then give desired workspace name and workspaceroot and then click "OK". And also it does not give any error. But when I try to access the workspace to add files in it,I am not able to access it, it gives error as "the path is not found". This means workspace has not been created in my local system. Can you please help here? I am new to perforce so please answer accordingly.
In perforce a workspace (aka client) defines the mapping of depot files to the files in your workspace (this is called the "clientview").
Most probably you made a mistake in your client view or when adding the files so that they don't fit (e.g. you can't add a file to perforce when the client does not contain a mapping for the local path it is located to a location in the depot).
In order to give better advice you need to post the content your client and the path of the files you want to add.

Resources