Mercurial 替换克隆文件中的值?
假设我正在克隆一个存储库,我总是将其克隆到 C:\working_copies\
并且该项目的 build 中有变量.properties
填写为
(由我)。
有没有一种方法可以通过在文件中放置一些特殊值(在 ant 中类似于 ${base-dir}
或类似的值)来自动填充文件中的这些值对我来说这些 build.property 值?
Say I'm cloning a repository that I always clone to C:\working_copies\<customer-name>\<customer-project>\
and that the project has variables in it's build.properties
that get filled in with <customer-name> <customer-project>
(by me) everytime I clone the repo.
Is there a way that I can fill in these values in the file automatically by placing some special value in the file (in ant it's something like ${base-dir}
or something like that) that would fill in these build.property values for me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
选项 1:确保构建过程仅依赖于相对路径,并且不要更改名称/项目变量
选项2:编写 挂钩,特别是克隆后挂钩,请尝试 hook 教程的书
option 1: make sure build process only relies on relative paths, and dont change name/project variable
option2: write a hook, specifically a post-clone hook, try the book for a hook tutorial
不,Mercurial 完全不知道其存储库文件夹之外的内容。
No, Mercurial is completely unaware of what is outside of it's repository folder.
您应该能够使用关键字扩展来配置它。只需设置一个 HGRC,在更新时使用您想要的值填充工作目录。
You should be able to rig this up using the Keyword Extension. Just set up a HGRC that populates the working directory with the values you want upon update.