如何仅在Mercurial队列中推送一个特定补丁? [英] How to push just one specific patch in Mercurial Queues?

查看:64
本文介绍了如何仅在Mercurial队列中推送一个特定补丁?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这就是我所做的:

hg init
hg qnew -m "p1" p1.patch
; some changes
hg qrefresh
hg qpop
hg qnew -m "p2" p2.patch
; some changes
hg qrefresh
hg qpop

现在,这两个补丁是单独的功能,彼此之间没有任何关系.它们需要彼此独立.

Now those 2 patches were separate features and have nothing to do with each other. They need to be independent of each other.

现在我愿意了(因为我只想要第一个功能)

Now I do (because I want only the 1st feature)

hg qpush p1.patch

它说:

applying p2.patch
applying p1.patch

它给了我两者我所做的更改!

and it gives me both the changes I made !

我做错什么了吗?

当我告诉它推送特定补丁时,它也会推送其他补丁.

It pushes other patches also when I tell it to push a specific patch.

推荐答案

您忘记了一件事:MQ补丁集是 queue (队列).即,如果您可以在hg qseries中看到多个补丁,则必须记住-qpush | qpop将应用|不应用补丁,而不是按随机顺序,而是按顺序:从下往上推动,以相反顺序弹出

You forgot one thing: set of MQ-patches is queue (FIFO queue). I.e if you can see more than one patch in hg qseries, you have to remember - qpush|qpop will apply|unapply patches not in random order, but in sequential order: push from bottom to top, pop in reverse order

qpush的--move选项是随机访问(以及更改系列补丁的顺序作为副作用).您的情况(一次只使用一个补丁)和补丁名称

Random access (and changing order of patches in a series as side effect) is --move option for qpush. In your case (using only one patch at a time) and patches names

  • hg qpop -a
  • hg qpush --move p1.patch
  • hg qpop -a
  • hg qpush --move p2.patch
  • hg qpop -a
  • hg qpush --move p1.patch
  • hg qpop -a
  • hg qpush --move p2.patch

为了避免错误,您可以在别名部分重新定义qpush(对于此存储库),以始终使用--move选项

In order to avoid mistakes you can redefine qpush (for this repository) in aliases section for always use --move option

这篇关于如何仅在Mercurial队列中推送一个特定补丁?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆