How to back out qnew?

Harvey Chapman hchapman-hg at 3gfp.com
Wed Apr 4 17:24:26 UTC 2012


On Apr 4, 2012, at 1:06 PM, Roy Smith wrote:

> hg qnew -m "blah blah" station.py
> 
> and ended up with a patch that had all the changed files in it.  What's the best way to revert the qnew command and get my sandbox back to the pre-qnew state?

I'm not sure if this is the best way, but I do this:

hg qpop
hg import --no-commit REPO_ROOT/.hg/patches/station.py
hg qdelete station.py

As far as I know, no one has implemented "unshelve" for mq yet.

BTW The simpler route might have been this:

# Refresh the current patch to only contain station.py. All other modifications
# will be forgotten by mq.
hg qrefresh station.py
# Rename the patch to the originally intended name
hg qrename station-patch


I took a stab at "unshelve" below. I think you could alias this as it doesn't require any knowledge of the current patch name.

hg qrefresh NOTHING
hg qrename TO_DELETE
hg qpop -f
hg qdelete TO_DELETE




More information about the Mercurial mailing list