VersionControlServer.QueryMerges Method

Gets information for all the passed merges in a specified branch, or between two specified branches. This function does not let you get information about deleted files or folders. If you want information about deleted files or folders, you can use the overload method that takes ItemSpec objects instead of strings. This function also does not give you details on which files within each changeset were merged or not merged. If you want information about the merged files you can use the QueryMergesWithDetails method.

Namespace:  Microsoft.TeamFoundation.VersionControl.Client
Assembly:  Microsoft.TeamFoundation.VersionControl.Client (in Microsoft.TeamFoundation.VersionControl.Client.dll)

Syntax

'Declaration
Public Function QueryMerges ( _
    sourcePath As String, _
    sourceVersion As VersionSpec, _
    targetPath As String, _
    targetVersion As VersionSpec, _
    versionFrom As VersionSpec, _
    versionTo As VersionSpec, _
    recursion As RecursionType _
) As ChangesetMerge()
'Usage
Dim instance As VersionControlServer 
Dim sourcePath As String 
Dim sourceVersion As VersionSpec 
Dim targetPath As String 
Dim targetVersion As VersionSpec 
Dim versionFrom As VersionSpec 
Dim versionTo As VersionSpec 
Dim recursion As RecursionType 
Dim returnValue As ChangesetMerge()

returnValue = instance.QueryMerges(sourcePath, _
    sourceVersion, targetPath, targetVersion, _
    versionFrom, versionTo, recursion)
public ChangesetMerge[] QueryMerges(
    string sourcePath,
    VersionSpec sourceVersion,
    string targetPath,
    VersionSpec targetVersion,
    VersionSpec versionFrom,
    VersionSpec versionTo,
    RecursionType recursion
)
public:
array<ChangesetMerge^>^ QueryMerges(
    String^ sourcePath, 
    VersionSpec^ sourceVersion, 
    String^ targetPath, 
    VersionSpec^ targetVersion, 
    VersionSpec^ versionFrom, 
    VersionSpec^ versionTo, 
    RecursionType recursion
)
public function QueryMerges(
    sourcePath : String, 
    sourceVersion : VersionSpec, 
    targetPath : String, 
    targetVersion : VersionSpec, 
    versionFrom : VersionSpec, 
    versionTo : VersionSpec, 
    recursion : RecursionType
) : ChangesetMerge[]

Parameters

  • sourcePath
    Type: System.String

    If sourcePath is null, you will get all merges that have occurred on the targetPath. If sourcePath is not null, you will get all merges that have occurred between these two branches.

  • sourceVersion
    Type: Microsoft.TeamFoundation.VersionControl.Client.VersionSpec

    If you specify a sourcePath, use sourceVersion to specify its version. Use VersionSpec.Latest to specify the current version. This parameter is used to specify what the target item is actually, not to filter the results of the query, which accomplished by versionFrom and versionTo.

  • targetPath
    Type: System.String

    The item that you want to find all merges for. This value must not be null. Both this and the source path may represent Team Foundation Server paths ($/CmdLine/parse.cs) or local paths (C:\Code\CmdLine\parse.cs) If local paths are used, they are mapped to server paths using a workspace; however, if two local paths are in different workspaces, an exception occurs.

  • targetVersion
    Type: Microsoft.TeamFoundation.VersionControl.Client.VersionSpec

    The version of the required target spec. Use VersionSpec.Latest to specify the current version. This parameter is used to specify what the target item is actually , not to filter the results of the query, which is accomplished by versionFrom and versionTo.

  • recursion
    Type: Microsoft.TeamFoundation.VersionControl.Client.RecursionType

    The recursion parameter controls what occurs if the path is a folder.

    RecursionType.None designates the folder itself. (This is rarely used, as there are not many changes you can make on a folder itself.) RecursionType.OneLevel designates the files and folders directly inside that folder; RecursionType.Full designates all files and folders in the tree under that folder.

Return Value

Type: array<Microsoft.TeamFoundation.VersionControl.Client.ChangesetMerge[]
Returns an array of ChangesetMerge objects that describes the completed merges. Each merge is a particular changeset from the source branch that was merged into the target branch. The object gives the changeset ID of the change in the original source branch, the changeset ID of the change in the target branch that was created by the merge, and a Boolean variable that indicates if this merge was only partial (the complete changeset was not merged into the target branch).

.NET Framework Security

See Also

Reference

VersionControlServer Class

VersionControlServer Members

Microsoft.TeamFoundation.VersionControl.Client Namespace