How to get accidentally deleted patch in Mercurial with MQ

I had two patches in the series, none were applied, and I accidentally called qdelete on the wrong one. Is there any way to cancel this operation and return my patch? I had a huge amount of work in this!

+4
source share
2 answers

How to avoid this (and I know that it’s not useful right now, sorry) not just use Mercurial Queues, mq, but use it with the patch repository. Mercurial / mq has great support for this.

When you first create the queue, you do:

hg qinit --create-repo 

(instead of just hg qinit ), which creates a new Mercurial repository in your .hg/patches directory. Then you can use:

 hg commit --mq 

to commit all your patch files and return them back would be simple:

 hg revert --mq 

On the bottom line, and again I know that this does not help you now, but maybe it will help the next guy or you later: if you write code and it does not execute somewhere, "exists" - commit and click earlier and often

+4
source

Unfortunately, if you did not use the -k option when invoking the qdelete , the patch file was also deleted. Thus, your only hope is either a backup or a tool that can perform some β€œrestore” operation.

+3
source

Source: https://habr.com/ru/post/1345228/


All Articles