Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to revert to an earlier revision of a project in Perforce following a deletion?

Tags:

perforce

Let's say I have a project under //depot/MyProject. At changelist 1001, this project took a major change in direction, changing everything about it. At changelist 2001, it got p4 deleted. The depot is now at change 3000.

I'd like to restore //depot/MyProject back to its state at changelist 1000. Specifically, I'd like the revision history to record the fact that change 3001 is an integration of change 1000 - i.e. the last version of this project before the major change.

Can Perforce do this at all? Or do I have to rename it into something like //depot/MyProjectOriginal, because //depot/MyProject is now tainted with all those deleted revisions?

(the naive attempt to p4 integrate //depot/MyProject/...@1000 //depot/MyProject/... fails with an "all revision(s) already integrated" message)

like image 948
Roman Starkov Avatar asked Dec 28 '22 15:12

Roman Starkov


1 Answers

You cannot force the integration.

You have two options: you can create a branch using changelist 1000 as the base; or sync to changelist 1000, check out all files, and then submit (a.k.a rolling back).

Option 1

If you do want the history of your changes between 1001-3000 (i.e. a fresh start from changelist 1000) then this is the better option. Using P4V, create a new branchspec and then perform an integrate from your current project to the new branch at changelist 1000. This will be submitted as changelist 3001, when you compare differences between revisions, you will not see of the changes between 1001-3000.

In the P4 visualizer this will appear as a new branch creation at 1000.

Option 2

Sync to changelist 1000, check out all files, and then submit. There should not be any conflicts to resolve. This will be submitted as changelist 3001, however when you review history you will see the everything.

I hope this makes sense, any questions, please ask.

like image 87
Dennis Avatar answered May 04 '23 01:05

Dennis