使用 Mercurial 的 mq 管理本地更改
我有一个本地 Mercurial 存储库,其中包含一些特定于站点的更改。 我想做的是将几个文件设置为不可提交,这样当我执行不带参数的 hg commit
时,它们就不会自动提交。
现在,我正在使用 mq 和守卫做复杂的事情来实现这一点,推送、弹出和选择守卫以防止我的更改(已签入 mq 补丁)被提交。
有没有更简单的方法来做到这一点? 每次我想要提交不包含站点特定更改的更改时,我都厌倦了阅读所有 mq
命令的帮助。
I have a local mercurial repository with some site-specific changes in it. What I would like to do is set a couple files to be un-commitable so that they aren't automatically committed when I do an hg commit
with no arguments.
Right now, I'm doing complicated things with mq
and guards to achieve this, pushing and popping and selecting guards to prevent my changes (which are checked into an mq patch) from getting committed.
Is there an easier way to do this? I'm sick of reading the help for all the mq
commands every time I want to commit a change that doesn't include my site-specific changes.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我会将这些文件放入
.hgignore
中,并提交这些文件的“示例”形式,以便当有人检查您的代码时可以轻松地为新站点重新创建它们。I would put those files in
.hgignore
and commit a "sample" form of those files so that they could be easily recreated for a new site when someone checks out your code.我知道 bazaar 有搁置和取消搁置命令来推送和弹出您不想包含在提交中的更改。 我认为 Mercurial 很可能有类似的命令。
I know that bazaar has shelve and unshelve commands to push and pop changes you don't want included in a commit. I think it's pretty likely that Mercurial has similar commands.
我很好奇为什么你不能用这些特定的更改检查另一个存储库,然后在需要更新内容时移植/拉取/修补它。 然后,您将主要从原始存储库进行工作,并且不会浪费空间,因为 hg 使用链接。 我通常会签出两个以上的版本,这样我就可以进行许多更新,然后将它们合并在一起。
I'm curious why you can't have another repo checked out with those specific changes, and then transplant/pull/patch to it when you need to update stuff. Then you'd be primarily working from the original repo, and it's not like you'd be wasting space since hg uses links. I commonly have two+ versions checked out so I can work on a number of updates then merge them together.