CheckInFiles(Objects: IMetabaseObjectDescriptors, FileNames: Array, Var ResId: Integer): Boolean;
CheckInFiles(Objects: Prognoz.Platform.Interop.Metabase.IMetabaseObjectDescriptors; FileNames: Array; var ResId: uinteger): boolean;
Objects. The objects, which changes must be checked in. Changed objects can be set manually or obtained using the IMetabase.GetPendingChangesVCS method.
FileNames. Array of paths to changed object files. Paths to changed object files can be set manually or obtained using the IMetabaseObjectDescriptor.LocalCheckedOutFileNames property.
ResId. The variable, into which an error code is stored.
The CheckInFiles method checks in changes in the specified objects.
This method can be used if objects are added to version control system.
When objects are added to version control system, files that store local object versions are created automatically. The set of files depends on object types.
For details see the Adding Objects to Version Control System section.
Method execution depends on the version control system in use:
Team Foundation Server. After executing the method the Check In dialog box opens for objects check-in.
Git. After executing the method the specified objects are checked in.
If changes were successfully checked in, the method returns True, and error code is set to 0. If changes were not checked in, the method returns False, and the ResId parameter is set to code error.
To execute the example, make sure that the repository is connected to the Git version control system and it contains changed objects.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
Objects: IMetabaseObjectDescriptors;
Object: IMetabaseObjectDescriptor;
FileNames: Array Of String;
i, ResId: Integer;
Begin
MB := MetabaseClass.Active;
// Get changed objects and their files
Objects := MB.GetPendingChangesVCS;
For i := 0 To Objects.Count - 1 Do
Object := Objects.Item(i);
FileNames := Object.LocalCheckedOutFileNames;
End For;
// Check in obtained changes
MB.CheckInFiles(Objects, FileNames, ResId);
End Sub UserProc;
Imports Prognoz.Platform.Interop.Metabase;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Objects: IMetabaseObjectDescriptors;
Object: IMetabaseObjectDescriptor;
FileNames: Array;
i: Integer;
ResId: Uinteger;
Begin
MB := Params.Metabase;
// Get changed objects and their files
Objects := MB.GetPendingChangesVCS();
For i := 0 To Objects.Count - 1 Do
Object := Objects.Item[i];
FileNames := Object.LocalCheckedOutFileNames;
End For;
// Check in obtained changes
MB.CheckInFiles(Objects, FileNames, Var ResId);
End Sub;
After executing the example all changed object files are checked in.
See also: