Search code examples
mercurialtortoisehg

Is it possible to delete a single file in a shelf?


Iv'e made changes to several files and shelved them (the original ones were restored). Since then, one of the files was deleted in the repository and when I synced, from my working copy too. When I unshelve, my edited copy of the file causes merge problems (rejects) because the shelf lists it as edited, while it does not exist anymore in the working copy.

I would like to delete it directly from the shelf, but I do not see an option for that. If it's not possible, what is the correct way to deal with this situation?

I'm using TortoiseHg, but answers don't need to be specifically for that.


Solution

  • One approach is to update to a changeset which did contain the file that later got deleted, ideally the one upon which the shelved changes were based. Then you can unshelve the file into your working folder which removes it from the shelf, and subsequently revert that file assuming you don't need its modified contents.