Represents a pending changelist from Perforce.

Namespace:  P4API
Assembly:  p4api (in p4api)
Version: 1.0.0.0 (1.0.0)

Syntax

C#
public class P4PendingChangelist

Remarks

The P4PendindingChangelist object is used to submit files with P4.Net. The first step is to create a new pending changelist, then add the switches "-c", and "1234" (1234 is the changelist number) to all commands that are opening files. In P4.Net, there’s no straight-forward way to submit the default pending changelist. This is by design. If the client workspace has opened files in the default changelist before any P4.Net automation runs, those files will "come along for the ride" when you submit the default changelist. If the user has a JobView set, all jobs in that JobView will automatically be fixed when you submit the default changelist. Both of those behaviors are almost never desired, and I’ve found many scripts that have those bugs.

Examples

The following example demonstrates submiting files with P4PendingChangelist.
CopyC#
P4Connection p4 = new P4Connection();
p4.Connect();
P4PendingChangelist  cl = p4.CreatePendingChangelist("My New Changelist\nVery, Very bad description!\nShame on me!");
p4.Run("edit", "-c", cl.Number.ToString(), "//depot/path/foo.cs", "//depot/path/bar.cs");
// Do something to manipulate the files
cl.Submit();
p4.Disconnect();

Inheritance Hierarchy

System..::.Object
  P4API..::.P4PendingChangelist

See Also