Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perforce Revert Shows "file(s) not opened on this client"

Tags:

I'm trying to open an existing Perforce application. I made some local changes, like deleting files, which I want to undo (that is, I want my local copy to exactly match the repository once more -- delete added files, restore deleted files, and undo changes).

When I try to revert using the p4v gui client, I see this error:

 file(s) not opened on this client

What am I doing wrong?

I did manage to revert all the changed files, but not the added/removed files.

Edit: I did the following:

  • Connect to a Perforce server using p4v
  • Map a directory to my local file system (lets say C:\Perforce)
  • Get the latest version of the repository
  • Go to C:\Perforce in Windows Explorer
  • Delete some files and folders
  • Add some files and folders

I would like to get back to the "pristine" state, the copy of exactly what's on the server when I got the latest version of the repository for the first time.

like image 888
ashes999 Avatar asked Sep 19 '11 17:09

ashes999


People also ask

What does Perforce revert do?

Use p4 revert to discard changes made to open files, reverting them to the revisions last synced from the depot (with p4 sync ). This command also removes the reverted files from the pending changelists with which they're associated. An administrator can use the -C option to revert another user's open files.

What does clean do in Perforce?

The p4 clean command takes the following actions when finding inconsistencies between files in a user's workspace and corresponding depot files: Files present in the workspace, but missing from the depot are deleted from the workspace.

What does checkout mean in Perforce?

Before editing the files in your project, you should check them out first to make sure that you have the latest version of the files in your client workspace. When you check out files in Perforce, the files become writable. This means that you will be able to save the changes you made to a file.


2 Answers

By the looks of the edited description you added and deleted files directly on the filesystem and not through perforce. Therefore Perforce doesn't know anything about those changes so there is nothing to revert. Typically when you want to add a file you use 'p4 add" (or the equivalent p4v operation), and when you delete, you should use 'p4 delete' (or again, the equivalent p4v operation).

Really, the best option to get back to a pristine state is to nuke the local copy of the code in c:\perforce (in windows explorer), go to p4v, right click the area you want to sync, and choose "Get Revision..." and in the subsequent dialog, make sure that the "force operation" checkbox is checked. This will tell Perforce that you want a new copy of everything regardless of whether you had it synced or not.

You can also run "reconcile offline work" in p4v. Right click the depot area and choose that option. It will scan through the local folder structure and give you a report of what files have been added that don't exist in perforce, what files were deleted, and what files were modified. From that dialog, you can right click on local files that don't exist in perforce and delete them, or you can 'p4 add' them. You can also sync deleted files.

HTH.

like image 197
Mark Avatar answered Sep 28 '22 15:09

Mark


Just an extra not to point out another cause for this. If the file name contains an unusual character that cannot be translated correctly the name on the client will never match that on the server. The solution in this case is to spot that character in the file name (it will be a question mark emblem on Linux) and use a wildcard to help identify the file to the server so it can delete it etc (p4 deleting the file is a way to go).

like image 21
user5585327 Avatar answered Sep 28 '22 13:09

user5585327