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.StringIf 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.VersionSpecIf 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.StringThe 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.VersionSpecThe 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.
versionFrom
Type: Microsoft.TeamFoundation.VersionControl.Client.VersionSpecGets only merges that start from this version of the target.
Pass null to start with the very first merge. This version spec must be specified in date, latest, or changeset form.
versionTo
Type: Microsoft.TeamFoundation.VersionControl.Client.VersionSpecGets only merges up to a point that you specify. Pass null to end with the most recent merge. This version spec must be specified in date, latest, or changeset form.
recursion
Type: Microsoft.TeamFoundation.VersionControl.Client.RecursionTypeThe 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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.