HgVersion Task

Extracts the current Changeset ID and revision number of a Mercurial workspace.


Property Type Description Required
LibraryLocation string the path of the hg.exe command no
LocalPath string the local working copy yes
Timeout int the timeout for the task in milliseconds no


Property Type Description Required
Changeset string the changeset identifier of the current workspace no
Revision int the revision number of the current workspace no


This method use the hg summary command.
The name of the task conforms to the community standards as the MSBuild Community Tasks uses TfsVersion, SvnVersion as the name of the same kind of tasks.


Initialize the AssemblyRevision property with the revision number of the folder containing the current MSBuild project:

            <HgVersion LocalPath="$(MSBuildProjectDirectory)" Timeout="5000">
              <Output TaskParameter="Revision" PropertyName="AssemblyRevision" />

Last edited Mar 27, 2010 at 1:27 PM by Faz, version 3


No comments yet.