hg update --mq 不起作用?
我正在使用:Mercurial Distributed SCM(版本 1.9.1)
,并且我已完成以下操作:
D:\code\mqtest>hg init
D:\code\mqtest>hg qinit -c
D:\code\mqtest>echo NonQueue > first
D:\code\mqtest>hg st
? first
D:\code\mqtest>hg add first
D:\code\mqtest>hg commit -m nonqueue
D:\code\mqtest>hg log
changeset: 0:2d4bac63616a
tag: tip
user: Tempos
date: Mon Sep 26 00:52:49 2011 +0300
summary: nonqueue
D:\code\mqtest>hg log --mq
D:\code\mqtest>hg qnew a
D:\code\mqtest>echo Queue0 > first
D:\code\mqtest>hg st
M first
D:\code\mqtest>hg qref
D:\code\mqtest>hg qcommit -m "queue 0"
D:\code\mqtest>echo Queue1 > first
D:\code\mqtest>hg qref
D:\code\mqtest>hg qcommit -m "queue 1"
D:\code\mqtest>echo Queue2 > first
D:\code\mqtest>hg qref
D:\code\mqtest>hg qcommit -m "queue 2"
D:\code\mqtest>hg st
D:\code\mqtest>hg log --mq
changeset: 2:38d08315a300
tag: tip
user: Tempos
date: Mon Sep 26 00:53:46 2011 +0300
summary: queue 2
changeset: 1:bb8b7da2e728
user: Tempos
date: Mon Sep 26 00:53:33 2011 +0300
summary: queue 1
changeset: 0:1ac551a65492
user: Tempos
date: Mon Sep 26 00:53:22 2011 +0300
summary: queue 0
并且我尝试切换回 mq 中的特定版本:
D:\code\mqtest>hg up -r 0 --mq
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
D:\code\mqtest>cat first
Queue2
为什么我没有看到 Queue0内容?
I am using: Mercurial Distributed SCM (version 1.9.1)
, and I've done the following:
D:\code\mqtest>hg init
D:\code\mqtest>hg qinit -c
D:\code\mqtest>echo NonQueue > first
D:\code\mqtest>hg st
? first
D:\code\mqtest>hg add first
D:\code\mqtest>hg commit -m nonqueue
D:\code\mqtest>hg log
changeset: 0:2d4bac63616a
tag: tip
user: Tempos
date: Mon Sep 26 00:52:49 2011 +0300
summary: nonqueue
D:\code\mqtest>hg log --mq
D:\code\mqtest>hg qnew a
D:\code\mqtest>echo Queue0 > first
D:\code\mqtest>hg st
M first
D:\code\mqtest>hg qref
D:\code\mqtest>hg qcommit -m "queue 0"
D:\code\mqtest>echo Queue1 > first
D:\code\mqtest>hg qref
D:\code\mqtest>hg qcommit -m "queue 1"
D:\code\mqtest>echo Queue2 > first
D:\code\mqtest>hg qref
D:\code\mqtest>hg qcommit -m "queue 2"
D:\code\mqtest>hg st
D:\code\mqtest>hg log --mq
changeset: 2:38d08315a300
tag: tip
user: Tempos
date: Mon Sep 26 00:53:46 2011 +0300
summary: queue 2
changeset: 1:bb8b7da2e728
user: Tempos
date: Mon Sep 26 00:53:33 2011 +0300
summary: queue 1
changeset: 0:1ac551a65492
user: Tempos
date: Mon Sep 26 00:53:22 2011 +0300
summary: queue 0
And I tried to switch back to a particular revision in the mq:
D:\code\mqtest>hg up -r 0 --mq
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
D:\code\mqtest>cat first
Queue2
Why am I not seeing the Queue0 content?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当您使用
hg --mq update
更新.hg\patches
内的补丁时,您就在 mq 背后更改了 mq 补丁。换句话说:补丁本身会获取新内容,但不会自动重新应用。因此,您想要的工作流程是:
首先删除所有补丁,将它们更新为您想要的样子,然后重新应用它们。
让
hg --mq update
为您执行此操作实际上是一个有趣的想法,而且我知道您不是第一个对这两个命令之间缺乏集成感到惊讶的人。When you update the patches inside
.hg\patches
withhg --mq update
, then you're changing the mq patches behind mq's back. In other words: the patches themselves get the new content, but they are not re-applied automatically.So the workflow you want is to do:
where you first remove all patches, update them to look like you want, and then re-apply them.
Having
hg --mq update
do this for you would actually be an interesting idea, and I know that you're not the first one to be surprised about the lack of integration between the two commands.在队列中移动补丁时,您应该使用
qpush
和qpop
。来自教程:
You should be using
qpush
andqpop
when moving through patches in your queue.From the tutorial: