Mercurial:“分支”在文件级别?
我的用例是这样的:
我在不同的环境中开发,但在相同的代码库上。 为了能够编译我有不同的 Visual Studio 解决方案 反映不同开发环境的文件。 (不同开发环境:Win XP / Win 7 ->不同位置的第三方库等)
我想做的是保持两个环境之间的代码库同步 (即:.cs、.xml、.config 文件等),但具有不同的解决方案文件。
目前我所做的是在两个存储库之间推送/拉取更改 环境。 但目前我不知道如何排除解决方案文件 推/拉。
当然,解决方案文件也会随着时间而变化(例如,添加文件时)。 这些更改非常罕见,因此我宁愿进行两次类似的更改 而不是每次尝试同步源代码库时修复解决方案文件。
如何使用 Mercurial 最好地完成此任务?有可能吗?
谢谢,
贾巴
My use case is this:
I am developing in different environments, but on the same code base.
In order to be able to compile I have different Visual Studio solution
files which reflect the different developing environments.
(different development environments: Win XP / Win 7
-> 3rd party libraries in different locations etc)
What I would like to do is to keep the code base in synch between the both environemts
(i.e.: .cs, .xml, .config files etc), but having different solution files.
Currently what I do is push / pull changes between the repositories in the two
environments.
But at the moment I do not know how to exclude the solution files from being
pushed / pulled.
The solution files, of course, change over time as well (e.g. when adding files).
These changes are much more infrequent so that I'd rather do changes like that twice
rather than repairing the solution files each time I try to sync the source code base.
How can this best be done with Mercurial? Is it possible at all?
Thanks,
Jabba
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这基本上是 OSD(操作系统相关)文件的问题。许多糟糕的源代码控制系统(缺乏文件级分支)通过特殊的 OSD 目录和安装脚本来处理它们。您只需将不同平台或计算机设置的文件存储在不同的目录中,并在提交之前和签出之后使用脚本进行调整。
我个人赞成在相关位置使用符号链接,您只需将其重新指向当前平台的文件的正确位置即可。这并不理想,但比完全从版本控制中排除这些文件要好。
This is basically a problem of OSD (operating system dependent) files. Many bad source control systems (which lack file level branching) handle them through special OSD directories and setup scripts. Where you simply store files for different platform or computer setup in different directory and use script to adjust it before commit and after checkout.
I'm personally in favor of symlinks in relevant places which you simply repoint to the correct location with files for your current platform. It is not ideal, but better than excluding those files from version control altogether.
将“骨架”文件存储在存储库中,使用本地 MQ 补丁修改每个位置解决方案文件(并使用 MQ,是的)
Store "skeleton" files in repo, modify for every location solution-files using local MQ-patches (and use MQ, yes)