hg update --mq 不起作用?

发布于 2024-12-06 13:47:21 字数 1509 浏览 0 评论 0原文

我正在使用: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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

戏舞 2024-12-13 13:47:22

当您使用 hg --mq update 更新 .hg\patches 内的补丁时,您就在 mq 背后更改了 mq 补丁。换句话说:补丁本身会获取新内容,但不会自动重新应用。

因此,您想要的工作流程是:

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

首先删除所有补丁,将它们更新为您想要的样子,然后重新应用它们。

hg --mq update 为您执行此操作实际上是一个有趣的想法,而且我知道您不是第一个对这两个命令之间缺乏集成感到惊讶的人。

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.

骄傲 2024-12-13 13:47:22

在队列中移动补丁时,您应该使用 qpushqpop

来自教程

补丁队列方面实际上也相当不错。你可以,为了
例如,在应用程序的两个不同层上工作(
低级以及在此基础上构建的东西)在同一队列中
同时不破坏东西。 qpush 和 qpop 将帮助你升级
并向下,同时保持您的更改分开。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文