How to push just one specific patch in Mercurial Queues?

后端 未结 1 1860
无人共我
无人共我 2021-01-27 00:30

This is what I did :

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
         


        
相关标签:
1条回答
  • 2021-01-27 01:16

    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

    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

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

    0 讨论(0)
提交回复
热议问题