Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reviving a deleted file for use in my workspace

Tags:

perforce

Greetings We run perforce with several users. Each user has their own development website that shows files in their workspace. This is great for making and viewing changes to webpages before submitting them.

Sometime ago, we deleted a few pages in Perforce. I would like to revive these pages, but not to make them visible on our live site. I want to view them in my workspace and on my dev site, but I do want to push them out to our live server.

In the "depot" tab of my P4 client, I can see the deleted files. I cannot see them in the "Workspace" tab of my client.

How can I revive them for use in my Workspace, but not make them live to the world?

I'm not a P4 admin so I could use a little guidance.

Thanks for any help,

like image 245
John Cowan Avatar asked Jan 23 '23 20:01

John Cowan


2 Answers

Found my answer. A colleague suggested I Google on "Get Revision..."

http://kb.perforce.com/UserTasks/ManagingFile..Changelists/RecoveringDeletedFiles

I used all but the last two steps and it worked.

In the P4V GUI:

  • Ensure that the deleted files are shown in the Depot View pane (go to the View menu, select the Filter Depot menu and click on Show Deleted Depot Files. In newer versions of P4V this will be in the 'Search' menu instead)
  • Locate the file in the Depot View pane
  • Context-click on the file and select "Get Revision"
  • In the "Get Revision" dialog box, click on the radio button for "Specify revision using:" and leave "Revision" in the drop down box
  • In the empty box to the right of the "Revision" drop down item, type in the number of the last good revision of the file
  • Click "Get Revision"
  • In the Depot View pane, context-click on the file and select "Mark for Add"
  • In the Depot View pane, context-click on the file and select "Submit"
  • Fill in the changelist description and click "Submit"
like image 55
John Cowan Avatar answered Jan 25 '23 23:01

John Cowan


With Perforce until you commit most commands don't do anything other than affect your local view of the repository.

So you can check out older versions of the file and have them in your client and as long as you don't check them in no one else (including your live site) will see them.

like image 31
Aaron Avatar answered Jan 26 '23 01:01

Aaron