ResolveConflict(Object: IMetabaseObjectDescriptor, File: String): Boolean;
ResolveConflict(Object: Prognoz.Platform.Interop.Metabase.IMetabaseObjectDescriptor; File: string): boolean;
Object. Object, which changes check-in caused the conflict.
File. Path to the file with object changes.
The ResolveConflict method opens the WinMerge application to resolve the conflict occurred on object changes check-in.
This method can be used if the object is added to version control system and a conflict on object changes check-in arose. The WinMerge application opens to resolve the conflict.
NOTE. The method is available only for the Git version control system in use.
To check in changes in the specified objects, use the IMetabase.CheckInFiles method.
To execute the example, make sure that the repository is connected to the Git version control system and it contains the changed object with the OBJECT_VCS identifier, and a conflict of object changes arises after changes check-in and version synchronization. The local repository of version control system contains files of the changed object at C:\GIT\GitRepo\OBJECT_VCS\.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
Objects: IMetabaseObjectDescriptors;
Object: IMetabaseObjectDescriptor;
FileNames: Array Of String;
ObjKeys: Array Of Integer;
ResId: Integer;
Begin
MB := MetabaseClass.Active;
// Set changed object
ObjKeys := New Integer[1];
ObjKeys[0] := MB.GetObjectKeyById("OBJECT_VCS");
Objects := MB.GetItems(ObjKeys);
Object := Objects.Item(0);
// Set changed object file
FileNames := New String[1];
FileNames[0] := "C:\GIT\GitRepo\OBJECT_VCS\OBJECT_VCS.text";
// Check in obtained changes
MB.CheckInFiles(Objects, FileNames, ResId);
// Synchronize versions
MB.PullPush;
// Resolve conflict
MB.ResolveConflict(Object, FileNames[0]);
End Sub UserProc;
Imports Prognoz.Platform.Interop.Metabase;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Objects: IMetabaseObjectDescriptors;
Object: IMetabaseObjectDescriptor;
FileNames: Array Of String;
ObjKeys: Array Of Integer;
ResId: Uinteger;
Begin
MB := Params.Metabase;
// Set changed object
ObjKeys := New Integer[1];
ObjKeys[0] := Mb.GetObjectKeyById("OBJECT_VCS") As Integer;
Objects := MB.GetItems(ObjKeys);
Object := Objects.Item[0];
// Set changed object file
FileNames := New String[1];
FileNames[0] := "C:\GIT\GitRepo\OBJECT_VCS\OBJECT_VCS.text";
// Check in obtained changes
MB.CheckInFiles(Objects, FileNames, Var ResId);
// Synchronize versions
MB.PullPush();
// Resolve conflict
MB.ResolveConflict(Object, FileNames[0]);
End Sub;
After executing the example, the OBJECT_VCS.text changed file of the specified object is checked in, the obtained server version is synchronized with the current version, and the WinMerge application opens to resolve the conflict. After resolving the conflict, the changes are saved in the OBJECT_VCS.text file.
See also: