Mercurial 队列特定命令是否等同于带有 --mq 参数的 Mercurial 命令?
我正在尝试学习 Mercurial 队列,但我对一堆“hg q*”命令和许多带有“--mq”参数的普通 hg 命令感到困惑。我认为 --mq 参数是为了替换一些 q* 命令,但我不确定。似乎没有关于(新的?)首选方法的教程或文档。
I'm trying to learn Mercurial Queues and I'm confused by there being both a bunch of "hg q*" commands and also many normal hg commands with the "--mq" parameter. I think that the --mq parameter is meant to replace some of the q* commands, but I'm not sure. There doesn't seem to be a tutorial or documentation on the (new?) preferred methods.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
--mq
选项会影响所有将存储库作为参数的命令 - 它实际上将目标存储库更改为$(hg root)/.hg/patches
,因此,它实际上与运行任何 Mercurial 命令相同:因此,每个具有
-R/--repository
选项的命令都有一个 --mq 选项,并且不需要修改即可获得一。您之前在 Mercurial 中使用过的任何命令:commit、push、pull、summary、id 等都可以采用--mq
。这是相关的python代码:The
--mq
option affects all commands that take a repository as an argument -- it actually changes the targeted repo to be$(hg root)/.hg/patches
, so it's effectively the same as running any mercurial command like this:Resultingly, every command that has a
-R/--repository
option has a --mq option and didn't need to be modified to get one. Any command you've previously used in mercurial: commit, push, pull, summary, id, etc. can take--mq
. Here's the relevant python code:--mq
标志使不必要的命令已被标记为弃用,以便它们从hg help mq
中消失。这就是qcommit
和qinit
不再出现的原因。如果您好奇,您仍然可以执行
hg qcommit
查看该命令的帮助。就我个人而言,我不喜欢
--mq
标志。相反,我使用 shell 别名:然后我可以执行
mq status
、mq commit
、mq Push
等。我发现两者之间的区别hg
和mq
命令名称与我对操作的看法相符。请注意,这个简单的别名没有考虑多个队列,因此如果您使用 hg qqueue,则必须对其进行一些扩展。The commands that the
--mq
flag make unnecessary have been marked deprecated so that they disappear fromhg help mq
. This is whyqcommit
andqinit
no long show up.You can still do
hg qcommit
to see the help for the command if you are curious.Personally, I don't like the
--mq
flag. Instead I use a shell alias:and then I can do
mq status
,mq commit
,mq push
, etc. I find that the distinction between thehg
andmq
command names match how I think of the operations. Note that this simple alias doesn't take multiple queues into account, so if you usehg qqueue
, then you'll have to extend it a bit.