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.
-
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– Bryan Pendleton2015-09-25 14:32:52 +00:00Commented Sep 25, 2015 at 14:32
-
yes, i have command line, something like p4 sync @labelnameuser3512111– user35121112015-09-25 15:13:01 +00:00Commented Sep 25, 2015 at 15:13
Add a comment
|
1 Answer
Try this:
p4.run("sync", "...@[labelname]")
or the more idiomatic
p4.run_sync("...@[labelname]")
3 Comments
user3512111
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
sferencik
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.user3512111
Thanks for the help!!