【发布时间】:2019-01-09 01:40:09
【问题描述】:
我们正在开发一个项目,其中编译 angularjs Web 项目并将二进制文件存储在 hg repo 中。问题是angularjs js文件通常使用散列编译所有二进制文件。例如:二进制文件后缀为每个文件的唯一扩展名
main.1cc794c25c00388d81bb.js,
polyfills.eda7b2736c9951cdce19.js,
runtime.a2aefc53e5f0bce023ee.js,
common.7d1522841bf85b01f2e6.js,
1.620807da7415abaeeb47.js,
2.93e8bd3b179a0199a6a3.....etc.
问题是每次在 hg repo 中签入新的二进制文件时,它都会被检测为新文件并与同名的旧文件一起保留。所以,我需要一种方法来欺骗 hg 存储库,以保留文件名,但仍将它们视为替换前一个文件的旧文件。
main.1cc794c25c00388d81bb.js ==> overwrite old main.js
polyfills.eda7b2736c9951cdce19.js ==> overwrite old polyfill.js
runtime.a2aefc53e5f0bce023ee.js ==> overwrite old polyfill.js
common.7d1522841bf85b01f2e6.js ==> overwrite old commom.js
1.620807da7415abaeeb47.js ==> overwrite old 1.js
2.93e8bd3b179a0199a6a3 ==> overwrite old 2.js
谁能指出一种方法,让 hg 认为这些文件只是对以前文件的修改而不是新文件? 可以使用 hgignore 或其他一些扩展...
【问题讨论】:
-
将这些实际提交给 Mercurial 的脚本是什么样的?
hg mv或hg addremove是告诉 Mercurial 有关重命名的唯一方法。 -
hg commit -m "FR xxxxxxxx: 增加了对 xyz 功能的支持" -u username filepath1 filepath2
标签: mercurial tortoisehg hgignore