Вопрос

P4V v2011.1

What p4v does now is syncing everything under the folder I want to sync. However, in my case the folder may have many subfolders, where I may only need to sync 50 of them and skip another 50 subfolders. Since we don't want to waste the bandwidth for transferring unwanted files, neither to right click on 50 subfolders to sync individually. Is there an easy way to sync ONLY files that are in my workspace?

Это было полезно?

Решение

It is possible via the command line using the #have specifier.

p4 fstat -T depotFile //...#have | p4 -x – sync
  1. p4 fstat -T depotFile //...#have returns the depot filespec for the files that currently have in your workspace.

  2. p4 -x – sync takes the output from the previous command (using the pipe |) and does a sync.

...

If you want this in P4V you can write a custom tool that calls WSH script.

var WshShell = new ActiveXObject("WScript.Shell");
var oExec = WshShell.Exec("p4 fstat -T depotFile //...#have | p4 -x – sync");    
while (oExec.Status == 0)
    WScript.Sleep(100);

WScript.Echo(oExec.Status);

Note: Using the above approach with #have will not sync any newly added files. Not sure if this is what you want.


Another approach entirely is to create a batch file that syncs the filespecs that you want. I have one that I run every morning that syncs multiple branches and projects.

To create you own, open notepad and add the necessary p4 sync commands one after each other.

p4 sync //projectA/...
p4 sync //projectB/folder1
p4 sync //projectB/folder2
...
p4 sync //projectB/folder5

A bit of work to setup initially.

or

Perhaps better than a batch file or script use two workspaces with the first with the full depot mapped and second using the limited mapping that you want 90% of the time.

Другие советы

What about editing your workspace view so that it specifies only the folders that you explicitly desire, and avoids using the '...' wildcard to recursively include subfolders?

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top