[p4] How to create new changelist

Sambwise perforce-user-forum at forums.perforce.com
Wed Mar 29 08:25:02 PDT 2017


Posted on behalf of forum user 'Sambwise'.

The API equivalent of --field is the Spec class.  I've never used
it from the C# API (hopefully it's in there!), but assuming it works
like it does in the C++ API it's pretty simple -- you need to get the
"specdef" string from the server (get this by passing the protocol
vars "tag" and "specstring" when you ask for the spec), use
that to set up a Spec object, and then feed the Spec the form dictionary (you
get this as well when you use the "tag" protocol).  Then you
can make changes to the dictionary and have the Spec object write the form back
out as plain text with Fmt().

Actually it's probably easier to just look at how --field is implemented
since that's exactly what it does.   :)
https://swarm.workshop.perforce.com/projects/perforce_software-p4/files/2016-1/client/clientuserdbg.cc#145



--
Please click here to see the post in its original format:
  http://forums.perforce.com/index.php?/topic/5240-how-to-create-new-changelist


More information about the perforce-user mailing list