如何在 Visual Studio Publish 上自动标记 Mercurial?

发布于 2024-08-27 06:31:45 字数 103 浏览 7 评论 0原文

我在 Visual Studio 2008 上使用 TortoiseHg + VisualHg。有没有人找到方法在我从 VS 发布时在 Mercurial 中自动创建标签(带有发布的版本号)?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无声静候 2024-09-03 06:31:45

您可以运行自定义脚本来将 hg tag 操作作为“发布后”操作来执行。查看 MSBuild 文档:

您将需要修改您的项目以添加自定义目标,如下所示:

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

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>
不寐倦长更 2024-09-03 06:31:45

感谢gavinb的回答和Sumo的评论。这是我为 WinForms 应用程序所做的方法:

  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <Target Name="AfterPublish">
    <GetAssemblyIdentity AssemblyFiles="$(OutputPath)\$(AssemblyName).exe">
      <Output TaskParameter="Assemblies" ItemName="AssemblyIdentities" />
    </GetAssemblyIdentity>
    <Exec Command="hg tag %(AssemblyIdentities.Version)" />
  </Target>

Thanks to gavinb's answer and Sumo's comment. This is the way I did it for my WinForms application:

  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <Target Name="AfterPublish">
    <GetAssemblyIdentity AssemblyFiles="$(OutputPath)\$(AssemblyName).exe">
      <Output TaskParameter="Assemblies" ItemName="AssemblyIdentities" />
    </GetAssemblyIdentity>
    <Exec Command="hg tag %(AssemblyIdentities.Version)" />
  </Target>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文