Jump to content


C# P4API.NET - Running "-Zproxyload"

sync

  • Please log in to reply
6 replies to this topic

#1 JuniorIncanter

JuniorIncanter

    Member

  • Members
  • PipPip
  • 10 posts

Posted 08 May 2014 - 05:05 PM

I'm trying to figure out how to use the P4API to make a call like "p4 -Zproxyload sync //depot/main/nonwritten.txt"

Adding -Zproxyload to the command variable fails as "-Zproxyload sync" isn't recognized, but it also isn't recognized as an argument.  In fact, I can't seem to figure out how to set global arguments in general.  Is this possible?

Also, if I wanted to add changelists to that command, does the order matter?  I.e. trying to add "1@100"?

Thanks.

#2 P4Matt

P4Matt

    Advanced Member

  • Members
  • PipPipPip
  • 1383 posts

Posted 08 May 2014 - 06:31 PM

Can you share a snippet of code where you are trying to do this?  think it'll be easier if I can show where to slot the code you need into what you have.

#3 JuniorIncanter

JuniorIncanter

    Member

  • Members
  • PipPip
  • 10 posts

Posted 08 May 2014 - 06:54 PM

public void PreloadCache(string file, string args)
{
    SyncTryRun("sync", "-Zproxyload", file, args);
}
P4RecordSet TryRun(string command, params string[] args)
{
    // some other stuff
    return result = this.connection.Run(command, args);
}

#4 P4Matt

P4Matt

    Advanced Member

  • Members
  • PipPipPip
  • 1383 posts

Posted 08 May 2014 - 09:00 PM

Looking at Shawn's API he doesn't appear to have a method for setting protocol variables. From the command line you'll note you're putting that before the sync because it is a flag for the connection, not the command. You'll probably need to grab his code and add a method to set a protocol variable on the connection.

The API we build also does not have built-in support for setting such protocol variables. I've filed a request for you.

#5 JuniorIncanter

JuniorIncanter

    Member

  • Members
  • PipPip
  • 10 posts

Posted 08 May 2014 - 10:00 PM

Yes, I did notice that in the command line I put it first.  I just couldn't figure where else to put it with the SyncTryRun method and it seems like that's because it doesn't have a place.

#6 P4Matt

P4Matt

    Advanced Member

  • Members
  • PipPipPip
  • 1383 posts

Posted 08 May 2014 - 10:34 PM

Yeah, unfortunately your best bet is probably to fire that off using p4.exe from your C# app. It will be faster than retrofitting either API to support setting protocol variables.

#7 mister_wilson

mister_wilson

    Advanced Member

  • Members
  • PipPipPip
  • 121 posts
  • LocationMontreal, Quebec

Posted 28 October 2016 - 06:53 PM

Hi P4Matt,

I know it's over 2 years later now, but I was wondering if anything became of the request you made to allow setting protocol variables ?
(Would this request be linked to allowing the API to support global options?)

Thanks,

-JW





Also tagged with one or more of these keywords: sync

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users