Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the best way to add this to P4V? #11

Open
zedmilner opened this issue Mar 17, 2023 · 1 comment
Open

What is the best way to add this to P4V? #11

zedmilner opened this issue Mar 17, 2023 · 1 comment

Comments

@zedmilner
Copy link

In P4V I can add it as a Custom tool, but if I select Run tool in terminal window, I can see the error logs, but no way to know when it's finished. If I also check Close window upon completion, then I kinda get a clue when it's finished (the window disappears), but then I can't read any errors.

If I don't select Run tool in terminal window, then the output is not visible anywhere, so that's not great either.

Also when using this as a P4V Custom Tool, I couldn't find a way to select just some folders and run p4vfs sync on those. It only shows up in the context menu when I select the workspace root folder. If I add %f or %F to the command line args ( those the only two that are using workspace syntax), then it doesn't show up in the context menu of any folders.

I'd be interested to learn how others integrated this to their workflow.

@jessk-msft
Copy link
Collaborator

Hi @zedmilner, in most cases that I know of we typically use p4vfs.exe commands a few ways:

  • Using p4vfs.exe from command line
  • Proprietary tools or scripts integrated with P4V
  • Tools integrated with a game engine, such as UnrealGameSync for UE4/UE5

Using a p4vfs command from a Custom Tool context menu is certainly an option. After a little experimentation, I'd probably suggest something like this in the %USERPROFILE%\.p4qt\customtools.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<!--perforce-xml-version=1.0-->
<CustomToolDefList varName="customtooldeflist">
 <CustomToolDef>
  <Definition>
   <Name>Virtual Sync</Name>
   <Command>p4vfs.exe</Command>
   <Arguments>sync %D</Arguments>
   <Shortcut></Shortcut>
  </Definition>
  <Console>
   <CloseOnExit>false</CloseOnExit>
  </Console>
  <AddToContext>true</AddToContext>
  <Refresh>true</Refresh>
 </CustomToolDef>
</CustomToolDefList>

You'll know the sync is complete when the sync summary shows at the bottom. You could also wrap this in a script if you wanted more detail. At Microsoft we have a tool that we can run from P4V shows a status bar of the progress of a p4vfs sync. Where progress is determined by reading the first count "(\d+) Modification messages to act on." followed by counting the number of lines output. I'll ask if one of my colleagues would be interested in contributing the source of that tool if anyone is interested.
Regards
-Jess

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants