VersionControlServer.QueryHistory Method (String, VersionSpec, Int32, RecursionType, String, VersionSpec, VersionSpec, Int32, Boolean, Boolean)

Gets the item history, in the form of an enumerable collection of Changesets for the specified items and versions. Download information is not included. Without download information the function call is faster, but if you want to download files, you should use the overload method that will allow you to get download information with the returned items.

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


Public Function QueryHistory ( _
    path As String, _
    version As VersionSpec, _
    deletionId As Integer, _
    recursion As RecursionType, _
    user As String, _
    versionFrom As VersionSpec, _
    versionTo As VersionSpec, _
    maxCount As Integer, _
    includeChanges As Boolean, _
    slotMode As Boolean _
) As IEnumerable
Dim instance As VersionControlServer 
Dim path As String 
Dim version As VersionSpec 
Dim deletionId As Integer 
Dim recursion As RecursionType 
Dim user As String 
Dim versionFrom As VersionSpec 
Dim versionTo As VersionSpec 
Dim maxCount As Integer 
Dim includeChanges As Boolean 
Dim slotMode As Boolean 
Dim returnValue As IEnumerable 

returnValue = instance.QueryHistory(path, _
    version, deletionId, recursion, user, _
    versionFrom, versionTo, maxCount, _
    includeChanges, slotMode)
public IEnumerable QueryHistory(
    string path,
    VersionSpec version,
    int deletionId,
    RecursionType recursion,
    string user,
    VersionSpec versionFrom,
    VersionSpec versionTo,
    int maxCount,
    bool includeChanges,
    bool slotMode
IEnumerable^ QueryHistory(
    String^ path, 
    VersionSpec^ version, 
    int deletionId, 
    RecursionType recursion, 
    String^ user, 
    VersionSpec^ versionFrom, 
    VersionSpec^ versionTo, 
    int maxCount, 
    bool includeChanges, 
    bool slotMode
public function QueryHistory(
    path : String, 
    version : VersionSpec, 
    deletionId : int, 
    recursion : RecursionType, 
    user : String, 
    versionFrom : VersionSpec, 
    versionTo : VersionSpec, 
    maxCount : int, 
    includeChanges : boolean, 
    slotMode : boolean
) : IEnumerable


  • path
    Type: System.String

    The item for which you want to get the history. The string may represent a Team Foundation Server path ($/CmdLine/parse.cs) or a local path (C:\Code\CmdLine\parse.cs), in the latter case, the local path is mapped to a server path via a workspace. Wildcards are also supported.

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

    The version of the specified item for which history should be queried.

    This is not a filter on which versions will be returned, like versionFrom and versionTo, it clarifies what file or folder for which you getd the history.

  • deletionId
    Type: System.Int32

    A deletion ID assigned for the item, if it is deleted. Use 0 for a non-deleted item. Note that this refers to the passed item, not to any lower-level items which the histories of may be discovered in a recursive search.

  • user
    Type: System.String

    The user for whom history should be queried (null for all users).

  • maxCount
    Type: System.Int32

    The maximum number of history entries that should be returned. Use Int32.MaxValue to get all changes.

  • includeChanges
    Type: System.Boolean

    A flag that, if true, includes the individual item changes with the changesets, otherwise, only changeset metadata is included.

  • slotMode
    Type: System.Boolean

    The slotMode comes into play when there have been multiple items with the same Team Foundation Server path. For instance, you may have had a file called $/CmdLine/parser.cs and then deleted it and added a different file called $/CmdLine/parser.cs. If slotMode is true, the returned changesets may reflect both (all) of these items. If it is false, the returned changesets will reflect the single item that currently occupies the requested path, regardless of whether it previously occupied the requested path in its historical version.

Return Value

Type: System.Collections.IEnumerable
A collection of Changeset objects that matches the query, in reverse-chronological order.

.NET Framework Security

See Also


VersionControlServer Class

VersionControlServer Members

QueryHistory Overload

Microsoft.TeamFoundation.VersionControl.Client Namespace