Jump to content


Avoid redownloading workspace if have most of it already?


  • Please log in to reply
1 reply to this topic

#1 Macktek

Macktek

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 13 February 2019 - 09:49 AM

A team member has a backup copy of a slightly older version of the workspace on USB.
Since the number of files is several thousand, (take about an hour to get the complete revision for him), is there a way in P4V to get the files without doing a complete redownload?

I was hoping something along the lines of:
Copy files from USB to Folder.
create new workspace with Folder Name.
In Perforce, right click the Depot and choose "Get Revision, but only if the file doesn't match " or something similar.

How would I do that?

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 784 posts

Posted 13 February 2019 - 05:23 PM

This isn't something that you can do in P4V as far as I know, but from the command line it's very simple:

p4 sync -k
p4 clean

The "p4 sync -k" (which is the part that I don't think you can do in P4V) tells the server "pretend I just synced all the files".  The "p4 clean" tells the server "check that everything in my workspace matches what you think I have synced, and fix anything that doesn't match."  If you run those two commands in an empty workspace, the "p4 clean" will just end up syncing everything that the "p4 sync -k" pretended to sync, but in the situation you describe, it'll only sync the files that are out of date.

If you run "p4 sync -k" on its own your workspace will probably be inconsistent and lots of things will go wrong (which is why it's not exposed in P4V).  You almost always want to follow up a "p4 sync -k" with either "p4 clean" or "p4 reconcile" to get things back into a consistent state.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users