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.
Asked
Active
Viewed 567 times
0
-
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? – Bryan Pendleton Sep 25 '15 at 14:32
-
yes, i have command line, something like p4 sync @labelname – user3512111 Sep 25 '15 at 15:13
1 Answers
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
-