Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2005
Visual Studio
Visual Studio SDK
QueryHistory Method
 QueryHistory Method (String, Versio...

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
Reference for Team Foundation Server SDK
VersionControlServer.QueryHistory Method (String, VersionSpec, Int32, RecursionType, String, VersionSpec, VersionSpec, Int32, Boolean, Boolean)

Retrieves an enumerable collection of changesets matching the specified items and versions.

Namespace: Microsoft.TeamFoundation.VersionControl.Client
Assembly: Microsoft.TeamFoundation.VersionControl.Client (in microsoft.teamfoundation.versioncontrol.client.dll)

Visual Basic (Declaration)
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
Visual Basic (Usage)
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)
C#
public IEnumerable QueryHistory (
	string path,
	VersionSpec version,
	int deletionId,
	RecursionType recursion,
	string user,
	VersionSpec versionFrom,
	VersionSpec versionTo,
	int maxCount,
	bool includeChanges,
	bool slotMode
)
C++
public:
IEnumerable^ QueryHistory (
	String^ path, 
	VersionSpec^ version, 
	int deletionId, 
	RecursionType recursion, 
	String^ user, 
	VersionSpec^ versionFrom, 
	VersionSpec^ versionTo, 
	int maxCount, 
	bool includeChanges, 
	bool slotMode
)
J#
public IEnumerable QueryHistory (
	String path, 
	VersionSpec version, 
	int deletionId, 
	RecursionType recursion, 
	String user, 
	VersionSpec versionFrom, 
	VersionSpec versionTo, 
	int maxCount, 
	boolean includeChanges, 
	boolean slotMode
)
JScript
public function QueryHistory (
	path : String, 
	version : VersionSpec, 
	deletionId : int, 
	recursion : RecursionType, 
	user : String, 
	versionFrom : VersionSpec, 
	versionTo : VersionSpec, 
	maxCount : int, 
	includeChanges : boolean, 
	slotMode : boolean
) : IEnumerable

Parameters

path
version
deletionId

The unique deletion ID for the item, if it is deleted. If it is not deleted, specify zero.

recursion
user
versionFrom

The start of a version range for which history should be queried. Use a null reference (Nothing in Visual Basic) to start with the first changeset.

versionTo

The end of a version range for which history should be queried. Use a null reference (Nothing in Visual Basic) to end with the latest changeset.

maxCount

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

includeChanges

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

slotMode

A flag that specifies how history entries are searched. If true, the returned history entries may reflect multiple different items that have at one point occupied the requested path in the database. If false, the returned history entries will reflect the single item currently occupying the requested path, regardless of whether it previously occupied the requested path in its historical version.

Return Value

A collection of changeset objects that match the query.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
C# Example      Mahiways   |   Edit   |   Show History

         private static IEnumerable QueryHistory()
{
// Get a reference to our Team Foundation Server.
String tfsName = @" http://ps4474:8080 ";
TeamFoundationServer tfs = new TeamFoundationServer(tfsName);
             // Get a reference to Version Control. 
VersionControlServer versionControl =
(VersionControlServer)tfs.GetService(typeof(VersionControlServer));
             string path = @"$/TempTeamProject2";
VersionSpec version = VersionSpec.Latest;
int deletionId =0;
RecursionType recursion = RecursionType.Full;
string user = "mahesh_lambe";
             VersionSpec versionFrom = VersionSpec.ParseSingleSpec("115894", "mahesh_lambe"); //keep it 'null' for first version
VersionSpec versionTo = VersionSpec.ParseSingleSpec("109014", "mahesh_lambe"); //keep it 'null' for latest version
             int maxCount = Int32.MaxValue;
bool includeChanges = true;
bool slotMode = true;
//bool includeDownloadInfo = true;
             IEnumerable enumerable =
versionControl.QueryHistory(path,
version,
deletionId,
recursion,
user,
versionFrom,
versionTo,
maxCount,
includeChanges,
slotMode);
//,includeDownloadInfo);
            return enumerable;
}

~ Mahesh Lambe
http://mahiways.spaces.live.com/
http://maheshlambe.blogspot.com/

Tags What's this?: tfs (x) Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker