Force merge to delete files

Mads Kiilerich mads at kiilerich.com
Mon Jul 5 10:26:58 UTC 2010


  Nikolaus Rath wrote, On 07/04/2010 08:31 PM:
> Hello,
>
> I am merging with --config ui.merge=internal:other. This works fine if
> there are conflicting changes. However, when a file has been removed, I
> still have to manually decide what to do, e.g.
>
> resolving manifests
>   local changed bin/s3qltune which remote deleted
> use (c)hanged version or (d)elete? d
>
> How can I get rid of these prompts?

You would like "internal:other" to apply here and resolve the merge as 
delete? There is unfortunately no simple way to do that. The merge 
configuration only apply to merges of file content, not to "manifest 
merges". Improvements in this area is not trivial, as we have to stay 
100% backwards compatible and get all the corner cases right. The best 
way to get more flexibility and control over the merge process might be 
to write an extension with another merge implementation. GUI writers 
could also benefit from that.

You can generally use --noninteractive to disable prompts, but that will 
in this case not do what you want - and might also cause incorrect 
answer to other prompts.

But you can try to run the merge with --noninteractive, and then discard 
the (wrong) merge result and revert it to "other" with "hg revert --all 
-r otherrev".

Be careful - you are automating a gun that points at your feet.

/Mads



More information about the Mercurial mailing list