public static ListGetChangesetsBetweenDates(string sourceControlPath, DateTime fromDate, DateTime toDate) { TfsTeamProjectCollection projectCollection = TfsManager.Instance.ProjectCollection; VersionControlServer versionControl = projectCollection.GetService (); VersionSpec versionFrom = GetDateVSpec(fromDate); VersionSpec versionTo = GetDateVSpec(toDate); IEnumerable results = versionControl.QueryHistory( sourceControlPath, VersionSpec.Latest, 0, RecursionType.Full, null, versionFrom, versionTo, int.MaxValue, true, true); List changesets = results.Cast ().ToList(); return changesets; } private static VersionSpec GetDateVSpec(DateTime date) { string dateSpec = string.Format("D{0:yyy}-{0:MM}-{0:dd}T{0:HH}:{0:mm}", date); return VersionSpec.ParseSingleSpec(dateSpec, ""); }
Thursday, December 27, 2012
Retrieve historic changesets from tfs
Following code retrieves changesets between given dates from tfs:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment