How to merge only changes of certain files of a given changeset into a working copy?

Marko Käning mk362 at mch.osram.de
Fri Feb 27 07:04:05 CST 2009


> <untested code>
> $ hg merge <rev>
> $ hg revert `hg st|grep -v ^? |cut -f2 -d" "|grep -v <file to be retained>`
> </untested code>

Doing so I get the following warning:

 abort: uncommitted merge - please provide a specific revision

So, what you have to tell the revert is still the revision you would want 
to go back using "hg revert -r rev ...", if I am not mistaken.

Wondering why it would not use the branch you are on by default... Thought 
that would be the expected behaviour...


More information about the Mercurial mailing list