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.

Unheilig
  • 16,196
  • 193
  • 68
  • 98

1 Answers1

1

Try this:

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

or the more idiomatic

p4.run_sync("...@[labelname]")
sferencik
  • 3,144
  • 1
  • 24
  • 36
  • 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 – user3512111 Sep 29 '15 at 14:33
  • 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. – sferencik Sep 29 '15 at 15:21
  • Thanks for the help!! – user3512111 Sep 30 '15 at 07:24