views:

358

answers:

1

When I have two branches in Hg repo, how to merge only one file with another branch, without having all other files from changeset merged?

Is it possible to merge only certain files, instead of whole changeset?

+1  A: 

Nope. Mercurial works on a changeset basis.

But you can do a "dummy merge" where you ignore the incoming changes from one of the branches. Before you commit you could then revert selected files to whatever state you want:

% HGMERGE=internal:local hg merge     # keep my files
% hg revert --rev other-branch a.txt  # update a.txt to other branch
% hg commit -m 'Dummy merge to pick a.txt from other-branch.'

Maybe that will help you a bit.

Martin Geisler