如何仅在Mercurial队列中推送一个特定补丁?

编程入门 行业动态 更新时间:2024-10-11 21:29:20
本文介绍了如何仅在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队列中推送一个特定补丁?

本文发布于:2023-11-24 11:45:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1625072.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:队列   补丁   Mercurial

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!