共用方式為


Repository.QueryBranches Method

Find all of the relatives for each item spec.

For example: Craig branches a.cs -> b.cs; Justin branches b.cs -> c.cs; and Amy branches b.cs -> d.cs. Then the following data should be returned when QueryBranches is called by using a.cs, b.cs, c.cs, or d.cs: BranchToItem: a.cs, BranchFromItem: NULL; BranchToItem: b.cs, BranchFromItem: a.cs; BranchToItem: c.cs, BranchFromItem: b.cs; BranchToItem: d.cs, BranchFromItem: b.cs.

An additional complication is that the user asking for this data might not have Read permission on all of the branch relatives. When this occurs, the appropriate Item structure is set to NULL.

The RelativeToItemId, and RelativeFromItemId are assigned based on ServerItem;Changeset so that the caller of this API can always determine the shape of the graph, even if all of the data is not visible to the user.

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

Syntax

'Declaration
<WebMethodAttribute> _
Public Function QueryBranches ( _
    workspaceName As String, _
    workspaceOwner As String, _
    items As ItemSpec(), _
    version As VersionSpec _
) As BranchRelative()()
[WebMethodAttribute]
public BranchRelative[][] QueryBranches(
    string workspaceName,
    string workspaceOwner,
    ItemSpec[] items,
    VersionSpec version
)
[WebMethodAttribute]
public:
array<array<BranchRelative^>^>^ QueryBranches(
    String^ workspaceName, 
    String^ workspaceOwner, 
    array<ItemSpec^>^ items, 
    VersionSpec^ version
)
[<WebMethodAttribute>]
member QueryBranches : 
        workspaceName:string * 
        workspaceOwner:string * 
        items:ItemSpec[] * 
        version:VersionSpec -> BranchRelative[][] 
public function QueryBranches(
    workspaceName : String, 
    workspaceOwner : String, 
    items : ItemSpec[], 
    version : VersionSpec
) : BranchRelative[][]

Parameters

  • workspaceName
    Type: System.String

    The workspace to resolve ItemSpecs against.

Return Value

Type: array<array<Microsoft.TeamFoundation.VersionControl.Server.BranchRelative[][]
BranchRelative[][]

.NET Framework Security

See Also

Reference

Repository Class

Microsoft.TeamFoundation.VersionControl.Server Namespace