Created
November 28, 2012 05:37
-
-
Save aaronpowell/4159243 to your computer and use it in GitHub Desktop.
Get changeset from workspace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var localPath = "Some Path"; | |
if (!Workstation.Current.IsMapped(localPath)) { | |
Log.LogError(string.Format("The local path '{0}' is not mapped to a TFS workspace.", LocalPath)); | |
return false; | |
} | |
var info = Workstation.Current.GetLocalWorkspaceInfo(localPath); | |
var collection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(info.ServerUri); | |
var workspace = info.GetWorkspace(collection); | |
var localVersions = workspace.GetLocalVersions(new [] {new ItemSpec(localPath, RecursionType.Full)}, false); | |
var changeset = localVersions[0].Max(v => v.Version); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment