How to revert to an earlier version of a project in Perforce after uninstallation?

Say I have a project under //depot/MyProject . In the list of changes 1001, this project has greatly changed direction, changing everything about it. In the 2001 change list, he received p4 delete d. Depot now changes to 3000.

I would like to restore //depot/MyProject back to its state in change list 1000. In particular, I would like the change history to capture the fact that change 3001 is an integration of change 1000 - that is, the latest version of this project before a major change.

Can Perforce do this at all? Or do I need to rename it to something like //depot/MyProjectOriginal , because //depot/MyProject now corrupted by all remote versions?

(naive attempt p4 integrate //depot/MyProject/ ...@1000 //depot/MyProject/... fails with the message "all revisions are already integrated")

+4
source share
5 answers

You cannot force integration.

You have two options: you can create a branch using change list 1000 as a base; or synchronize with change list 1000, check all files and then send (aka rollback).

Option 1

If you need a history of changes between 1001-3000 (i.e. a new start from the list of changes 1000), then this is the best option. Using P4V, create a new branch, and then integrate from your current project into a new branch in change list 1000. This will appear as change list 3001, when you compare differences between versions, you will not see changes between 1001-3000.

In the P4 renderer, this will appear as a new 1000 branch creation.

Option 2

Synchronize with change list 1000, check all files and then send. Conflicts should not be allowed. This will appear as a list of changes 3001, however , when you view the history, you will see everything.

I hope this makes sense, please ask any questions.

+5
source

I do not believe that you can integrate files on top of each other. I think you have two options.

If you want to move files, you can do

 p4 integ //depot/MyProject/ ...@1000 //depot/MyOriginal/Project/... 

and this will integrate MyProject into 1000 change list in a new location.

If you want to save the project in one place, you can also do it. This is really the easiest way in p4v - you can right-click on a folder in the workspace or in depot mode and select "rollback ...". In the next dialog box, you can select a list of changes (or date, revision, etc.) to return to the folder. In your case, I believe that you have selected change list 1000. Insert the files into the new pending change list (I think this is always good practice). Then you can run preveiw (see what happens), save the contents to a new list of changes (so you can check the contents of the file before sending), or just go break and pull the trigger and send (I will not recommend this at all).

NTN

+2
source

Just do:

 p4 copy //depot/MyProject/ ...@1000 //depot/MyProject/... 

It also makes a good schedule of changes.

+2
source

Although there is an acceptable answer and many other solutions, none of them work for me. I need to roll back a large directory (with GB of data).

Here's how I used it, which works great for a huge catalog: (Recommended to be done in a new and clean workspace, although this is not required)

Assuming the rollback directory is // depot / foo / bar and you want to roll back to change list 1234

  • Make sure no one is blocking any files, and make sure that the directory you are trying to roll back exists in the client specification
  • p4 copy -v //depot/foo/bar/ ...@1234 //depot/foo/bar/...
  • p4 submit

p4 copy -v is the meat of the solution. It tells the Perforce server to perform a virtual copy, which means that Perforce is copying files, but not really in your workspace. This avoids the huge transfer of data for the contents of the file (when copying and sending). In my case, using the "rollback" in P4V (which makes a non-virtual copy), it took more than an hour to copy and more than an hour to send to my folder. With a virtual copy, the whole process took about 1 minute.

Most importantly, he keeps a reasonable story. You can see that your files are being updated and rolled back, and the entire previous history exists.

+1
source

using p4 integrate -f //depot/MyProject/ ...@1000 //depot/MyProject/...

The -f flag means force integration, even if it is already integrated. From http://www.perforce.com/perforce/doc.current/manuals/cmdref/integrate.html

0
source

All Articles