Search code examples
visual-studio-2008mercurialpublishtortoisehgvisualhg

How to Auto tag Mercurial on Visual Studio Publish?


I am using TortoiseHg + VisualHg on Visual Studio 2008. Has anyone found way to automatically create a tag (with the published version number) in Mercurial whenever I do a publish from VS?


Solution

  • You can run a custom script to perform the hg tag operation as an "AfterPublish" action. Have a look at the MSBuild documentation:

    You will need to modify your project to add a custom target like this:

    <Project>
        ...
        <Target Name="AfterBuild">
            <Exec Command="hg tag %(TAGNAME)"/>
        </Target>
    </Project>