如何从Mercurial存储库获取修订号并将其粘贴到NetBeans资源包?

如何从Mercurial存储库获取修订号并将其粘贴到NetBeans资源包?,netbeans,mercurial,versioning,resourcebundle,Netbeans,Mercurial,Versioning,Resourcebundle,我在NetBeans中有一个java项目,我使用Mercurial进行版本控制。 我想在“关于”框中看到我的项目版本号,并希望它根据Mercurial修订号进行更新。 有什么办法吗?:) 在“”之后,您可以在VERSION.TXT文件中记录(关于对话框将显示的)以下结果: hg log -r . --template '{latesttag}-{latesttagdistance}-{node|short}' : 日志将更好(和正确)地使用: 您在“”中有更多选项 版本\u gen.sh带有:

我在NetBeans中有一个java项目,我使用Mercurial进行版本控制。 我想在“关于”框中看到我的项目版本号,并希望它根据Mercurial修订号进行更新。 有什么办法吗?:)

在“”之后,您可以在VERSION.TXT文件中记录(关于对话框将显示的)以下结果:

hg log -r . --template '{latesttag}-{latesttagdistance}-{node|short}'
:

日志将更好(和正确)地使用:

您在“”中有更多选项

版本\u gen.sh
带有:

 hg parent --template "r{node|short}_{date|shortdate}" > version.num
在makefile中,确保在使用
version.num
设置版本参数之前运行
version\u gen.sh

如果是Windows,则(“SubWCRev for Mercurial”)也可能有用

Replaces revision information in a tagged text file.

MercurialRev <SourceFile> <DestinationFile> <RepositoryPath>

Tags:
    <$HG:REV_NUM$>
    <$HG:REV_LMOD_N$>
    <$HG:REV_LMOD_P$>
    <$HG:REV_ID$>
    <$HG:BRANCH$>
    <$HG:TAG$>
替换标记文本文件中的修订信息。
墨丘里亚雷夫
标签:

version\u gen.sh的示例script:log使用
hg log-r技巧--template“{latesttag}.{latesttagdistance}”
@lazybacker好的,为了更直观,我在答案中包含了它。我需要从给定的分支获得这个(以编程方式),所以我使用了
hg log-l-b--template“{node}\n”
Replaces revision information in a tagged text file.

MercurialRev <SourceFile> <DestinationFile> <RepositoryPath>

Tags:
    <$HG:REV_NUM$>
    <$HG:REV_LMOD_N$>
    <$HG:REV_LMOD_P$>
    <$HG:REV_ID$>
    <$HG:BRANCH$>
    <$HG:TAG$>