如何避免意外“hg推”?而不是“hg qpush”?
对于那些使用带有 MQ 扩展的 Mercurial 的用户:
这是我第二次不小心将更改提交到中央存储库 (hg Push
),而不是将补丁应用到我的工作目录 (hg qpush
)。
我认为这是非常不幸的,因为这是一个非常简单的错误,并且会产生非常严重的后果(至少需要执行 hg backout
和额外的 hg Push
为了生成一个新的提交,将 las 的提交“撤消”到中央存储库,但历史记录变得复杂且令人不快。
每个提交的更改都是 因为这是一个完全主观的问题,所以
你有什么建议吗?我在想:
[alias]
push= <-- how to NOP the push command??
pushtoserver=push
这是社区维基
。
For those of you that use Mercurial with the MQ extension:
This is the second time I accidentally submit changes to the central repository (hg push
) instead of applying a patch to my working directory (hg qpush
).
I think this is very unfortunate, because it is a very simple error to make and has very severe consequences (the least having to do a hg backout
and an extra hg push
for each submitted change in order to generate a new commit that "undoes" the las one to the central repository, but the history becomes convoluted and unpleasant.
My goal is to configure some alias or something in my environment in orden to make hg push
harder to do by accident.
Do you have any suggestions? I was thinking something like:
[alias]
push= <-- how to NOP the push command??
pushtoserver=push
As this is a completely subjective question, this goes as community wiki.
thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一些模糊的想法:
此钩子(bash 命令行)要求在将更改推送到远程之前进行确认(使用 Mercurial 1.4 进行测试):
some vague ideas:
This hook (bash command line) asks for confirmation before pushing changes to the remote (tested with mercurial 1.4):
将以下内容放入 .hgrc 中:
工作方式如下:
另请参阅 alias 部分hgrc 联机帮助页。
Put the following in your .hgrc:
Works like this:
See also the alias section of the hgrc manpage.