开发者

hg update --mq not working?

开发者 https://www.devze.com 2023-04-08 20:41 出处:网络
I am using: Mercurial Distributed SCM (version 1.9.1), and I\'ve done the following: D:\\code\\mqtest>hg init

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 q开发者_StackOverflowref
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?


When you update the patches inside .hg\patches with hg --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:

> hg qpop -a
> hg --mq update -r X
> hg qpush -a

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.


You should be using qpush and qpop when moving through patches in your queue.

From the tutorial:

The patch queue aspect is actually quite nice as well. You can, for example, work on two different layers of your application (something low-level and something built on top of that) in the same queue at the same time without breaking stuff. qpush and qpop will help you move up and down while keeping your changes separate.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号