3

hg shelve did it again - even after applying the patch described in hg unshelve not working (which worked happily for about a month), shelve just "lost" all my changes again.

I see the name of my shelve when running hg shelve -l, but when I do hg unshelve -n <name> I get the dreaded "nothing to unshelve" message.

I can see all the changes with hg unshelve -i -n <name>. What's the easiest way to get them back in my local repository since the unshelve command refuses to acknowledge that they're there, even though it will happily show them to me?

Community
  • 1
  • 1
Jer
  • 5,468
  • 8
  • 34
  • 41
  • I've been using mercurial for a few years and have never had this problem... was losing shelves a bug in hg that has since been fixed, maybe? – StayOnTarget Dec 21 '18 at 12:29

1 Answers1

5

You can try the patch command. hg help patch for some help.

I'm not familiar with the shelve extension, but I think you can do something like this :

$ hg unshelve -i -n <name> > modifications.patch 
$ hg patch modifications.patch
krtek
  • 26,334
  • 5
  • 56
  • 84
  • Yes, I actually realized that the shelve was a valid patch (as long as you remove the leading "directories" 'a' and 'b'). – Jer Apr 20 '12 at 17:05