Created
August 19, 2010 19:18
-
-
Save house9/538657 to your computer and use it in GitHub Desktop.
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
public static void ScriptMain(Project project) | |
{ | |
project.Log(Level.Info, "Connect to " + project.Properties["tfs.server"]); | |
TeamFoundationServer tfs = new TeamFoundationServer(project.Properties["tfs.server"]); | |
// Get a reference to Version Control. | |
Type type = typeof(VersionControlServer); | |
VersionControlServer versionControl = (VersionControlServer)tfs.GetService(type); | |
project.Log(Level.Info, "get changesetId for " + project.Properties["tfs.fullpath"]); | |
IEnumerable changeSets = versionControl.QueryHistory(project.Properties["tfs.fullpath"], VersionSpec.Latest, 0, RecursionType.Full, null, null, null, 1, true, false); | |
int latestChangesetId = 0; | |
// there is only one | |
foreach(Changeset c in changeSets) | |
{ | |
latestChangesetId = c.ChangesetId; | |
} | |
project.Log(Level.Info, "ChangesetId is " + latestChangesetId.ToString()); | |
project.Properties["project.version.revision"] = latestChangesetId.ToString(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment