Perforce API for the .Net CLR P4.Net

P4PendingChangelist Class

Represents a pending changelist from Perforce.

For a list of all members of this type, see P4PendingChangelist Members.

System.Object
   P4API.P4PendingChangelist

[Visual Basic]
Public Class P4PendingChangelist
[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.

Example

The following example demonstrates submiting files with P4PendingChangelist.

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();
      

Requirements

Namespace: P4API

Assembly: p4api (in p4api.dll)

See Also

P4PendingChangelist Members | P4API Namespace