views:

37

answers:

2

I have a repository I will call 'subset' which was cloned from another repository I will call 'full'. I deleted many files in subset using 'hg rm'. I now need to pull changes to the files remaining in subset from full, but I don't want to restore any of the files I deleted. If I do a pull followed by a merge, the merge will interactively ask me for each deleted file that was changed in full if I want to use the changed file or leave it deleted. Is there any way to automatically leave all deleted files deleted and save myself a repetitive stress injury?

As a side note, one time fixes (like using hg convert on full?) won't fly because both the full and subset repositories are being actively worked on, at least for now.

A: 

The easiest way to do this would be to rebase your removes on top of the modified files. This will work well as long as you didn't rename a lot of files.

See this answer for more details.

Johannes Rudolph
So what happens if I do this on my clone of subset and then push it to the 'published' version of subset that others have been modifying as well? There's is concern that they will end up having to either manually rebase their clones or do the merge I'm trying to avoid.
Alain Linden
A: 

Actually, hg convert is still the right way to do this. Convert works in an iterative fashion, so it will bring across only the new change sets. Use a --filemap with a bunch of exclude lines, and just re-run the convert command with the same source and destination clones, and you can iteratively filter whenever you need to merge.

This is a very common pattern if, say, a fraction of your total project is released to a broader audience.

Ry4an