English 中文(简体)
Faster clean Perforce sync over VPN
原标题:

I have to regularly do a clean Perforce sync to new hardware/virtual machines over the VPN. This can take hours as the project is quite large. Is there a way that I can simply copy an up-to-date tree from an existing client and tell Perforce to use this tree?

最佳回答

The Perforce Proxy is the right way to go, but if you really want to, there is a way to do what you asked via the sync command, with the -k switch:

The -k flag bypasses the client file update. It can be used to make the server believe that a client workspace already has the file. Typically this flag is used to correct the Perforce server when it is wrong about what files are on the client, use of this option can confuse the server if you are wrong about the client s contents.

p4 sync -k //depot/someProject/...

You can also use flush, which is a synonym for sync -k:

p4 flush //depot/someProject/...

Just be careful. Remember those last words, "...use of this option can confuse the server if you are wrong about the client s contents."

问题回答

Perforce Proxy is almost definitely the way to go, assuming you can dedicate a local machine for this purpose.

A useful tip for a Proxy is to get it to refresh its contents overnight, just by creating a dummy client (perhaps on the proxy machine), and kicking off a nightly task to do a sync - a normal sync will do, does not need to be a clean one. This will ensure any big changes people have checked in won t necessarily cause a massive lag the first time you need to do a local sync.

Note that you need a live VPN connection between the proxy and the server - the proxy still has to talk to the server to determine if it has the right versions cached. So the proxy needs a reasonably low latency link to the server, but at least you don t have to wait for actual file transfer.

Another alternative you may want to try is to use the compress option in your client specs (workspaces). This tells the server to compress each file before it gets sent, and your p4 client will decompress automatically. The trade-off here is CPU time on both the server and the client. However, given you want to sync several local clients, I think proxy will ultimately be the better solution.

No, but you shouldn t need to: Why do you need to do a clean perforce sync? What s wrong with a normal sync? If you need to clean the tree, then why not work on a copy of the tree?

One alternative might be to run a p4proxy on your end of the VPN connection, then unchanged files won t have to be transferred over the VPN.

If you only require an export - that is you don t need to keep it up-to-date or submit changes from it, then you could simply copy an existing checkout, and never use perforce against that tree. But I don t know anyway of convincing perforce server that you have a checkout without p4 actually checking out the files.





相关问题
Anything similar to git-svn for Perforce?

Is there a tool that allows me to gain the same functionality as git-svn for Perforce? I saw git-p4 on github but it looks like this imports source from a git repo to a Perforce repo. Does it go the ...

Converting Perforce repositories in to mercurial

I have a perforce repository on Windows machine say (p4). I can access this p4 repo using p4v client by providing IP:PortNumber details. Now I want to run "hg convert" command on this p4 repository ...

using perforce with team foundation server

Does Team Foundation Server 2008 or upcoming 2010 work with perforce as the SCM tool? I haven t been able to find any documentation on the web indicating whether or not this configuration is supported?...

Can a script be automated after a commit on Perforce?

We use Perforce at work, and routinely keep software projects in the repository. In general creators follow the normal Perforce flow, BUT we also have a class of users, who doesn t have any need to ...

Faster clean Perforce sync over VPN

I have to regularly do a clean Perforce sync to new hardware/virtual machines over the VPN. This can take hours as the project is quite large. Is there a way that I can simply copy an up-to-date tree ...

热门标签