tags:

views:

834

answers:

1

Suppose i have made a change to a file, hg st show it as modified.

Now i want to commit. Before I can do so i do accidentially hg remove my file. Mercurial now would remove my file on the next commit, hg revert would retain it from removal, my changes would be lost however.

Is exporting a patch and then importing it on top of a MQ my only option to put my file back into "modified" state?

+2  A: 

I am not sure about that but try adding it back with hg add

And you can simply export and apply a patch without MQ

artemb
i know, however MQ lets me manipulate my "commit" before actually doing a real commit, importing a patch always results in a commit.
Johannes Rudolph
I mean apply to the working copy, not import
artemb
This is the correct answer. Using `hg add` on a file that is scheduled to be removed from tracking will undo the remove and leave the contents untouched.
Steve Losh
A note on your comment, Johannes Rudolph: "importing a patch always results in a commit". You can avoid that by doing `hg import --no-commit`
Ry4an
im more and more realizing im a mercurial noob :-) seemed so easy in the beginning, and after thinkin about it, indeed it _is_ simple! Mercurial ftw :-)
Johannes Rudolph