How to get previous path of renamed.moved of file using TFS API
-
Tuesday, March 30, 2010 11:16 AM
I want to get the previous path of file which is renamed/moved using TFS API.
All Replies
-
Thursday, April 01, 2010 11:31 AMModerator
Hi,
You can use QueryHistory to query all history of the Item,
VersionControlServer vcs = ...; string serverItemName = ...; System.Collections.IEnumerable changesets = vcs.QueryHistory( serverItemName, VersionSpec.Latest, 0, RecursionType.None, null, new ChangesetVersionSpec(1), VersionSpec.Latest, int.MaxValue, true, false ); foreach (Changeset changeset in changesets) { //this changeset that gotten in this way only includes one change, even though there may many changes indeed Console.WriteLine(string.Format("ChangeType:{0}\tServerItem:{1}" , changeset.Changes[0].ChangeType , changeset.Changes[0].Item.ServerItem )); }The change type may be
None = 1,
Add = 2,
Edit = 4,
Encoding = 8,
Rename = 16,
Delete = 32,
Undelete = 64,
Branch = 128,
Merge = 256,
Lock = 512,
Best regards,
Ruiz- Marked As Answer by Ruiz YiModerator Tuesday, April 06, 2010 5:49 AM

