0

I am trying to sync code to a particular label in the depot using the Python script with help of Python API provided by Perforce. Any help would be appreciated.

2
  • What have you tried so far? What has the result been so far? Do you know the equivalent p4 sync command-line formulation that you wish to run? Commented Sep 25, 2015 at 14:32
  • yes, i have command line, something like p4 sync @labelname Commented Sep 25, 2015 at 15:13

1 Answer 1

1

Try this:

p4.run("sync", "...@[labelname]")

or the more idiomatic

p4.run_sync("...@[labelname]")
Sign up to request clarification or add additional context in comments.

3 Comments

thanks for this. I am trying to search and read a labelname from the list of labelnames in the depot. Equivalent command line would be something like p4 labels -e * lname * where lname is a part of labelname. could you help please
Again, you could use p4.run_labels("-e", "*[labelpattern]*") and inspect the output (structured data). An alternative would be to use for label in p4.iterate_labels() and do your own filtering by [labelpattern] using regular expressions.
Thanks for the help!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.