Search code examples
backupperforceshelveunshelve

Perforce: move shelved files from workspace to backup


I have some old shelved files in long-standing pending Perforce changelists that I'll probably never submit. I'd like to get rid of those changelists because they're polluting my space, but I don't want to lose everything just in case I need those some day, so I need a backup.

Is there a way to move shelved files from a changelist to somewhere on the filesystem?

Drag-and-dropping the shelved files from P4V to a Windows explorer doesn't work. The command line tools p4 unshelve doesn't seem to have such an option. I'd also like to avoid unshelving the files first before backuping them, as this would mean additional headaches if those files are already checked out with edits.

EDIT

Reading the answers makes me realize that what I actually want is keeping this kind of changelist safe, but away from view (i.e. away from my usual workspace). I don't care if it's on my filesystem or somewhere else. So my question is actually:

Is there a way to move shelved files away from a workspace for backup?


Solution

  • Expanding upon Williams post, I suggest you create another workspace, not to sync but to store your shelved change lists!

    To do this, choose "Create new workspace" from "Connection" menu. Un-check the "Switch to new workspace immediately". Make the name the same as the current workspace and append a suffix such as "-shelf". Any root path will do, you won't be needing it. Now just pick the change lists you want to "put away", right click on them, choose "Change Ownership", enter the name of your new workspace name and it will be transferred to the new workspace and your current workspace will be nice and tidy.

    If you ever want to see what's on the shelf you can simply expand the filter at the top of the "Pending" tab and click the little circle X on the workspace line and perforce will show you ALL your change lists allowing you to browse and unshelve to the current workspace.

    The perforce server is the best place for backup. Perforce keeps track of the base revision of each shelved file, if you move it out of perforce this information will be lost possibly making it more difficult to integrate later.