Question

My use case:
I noticed that I made unnecessary edit in earlier revision and I want to discard one hunk from patch, and preserve all other changes for this file. I've tried to edit the patch inside .hg/patches/ and then hg qrefresh, but after that the hunk reappear.

Possible solutions:

  • Export that patch, cut all except unneeded hunk, and apply this patch in reverse.
  • Somehow make workdir "dirty" with patch that contains hunk, and then edit file nicely with GUI of my IDE, which polls VCS and highlights changes, and offer option to rever these changes.

Questions:

  • Is editing .hg/patches a valid practice?
  • How to make workdir dirty by neede patch and then reapply it with edits? Like git reset --soft?
  • Is there any other convenient methods to do subj?

No correct solution

OTHER TIPS

I made unnecessary edit in earlier revision

Doesn't have a much sense in terms of MQ. I'll answer in assumption "One patch in MQ-queue must get additional fixes and others saved as is"

Is editing .hg/patches a valid practice?

No, it's terrible worst choice

How to make workdir dirty by neede patch and then reapply it with edits? Like git reset --soft?

Apply this single needed patch in queue

hg qpop -a
hg qpush --move Mypatch

make needed changes, refresh patch

<edit>+<save> in IDE
hg qrefresh

unapply and move to the old position in queue

hg qpop
hg qpush --move SomeOther //set of pushes in order to restore old order
hg qpop -a
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top