How to tell Mercurial to automatically accept "its" version during a merge conflict of any files in a specific directory?

Firstly, I would prefer not to check the created files at all, but my manager insists. Therefore, given these limitations, I would like to create mercury “merge templates” that will always accept “their files” in all directories called “generated” in my working repo. I read the hgrc documentation and related post , and here is what I think it should look like this:

[merge-patterns] generated/** = internal:other #keep their files 

And that fits in my .hg / hgrc file. When I run the hg update with merge conflicts, this is what I get:

 > hg update couldn't find merge tool internal:other #keep their files specified for generated/** merging generated/file.sv 

So, I changed the "merge patterns" to look like this:

 [merge-patterns] **/generated/** = internal:other #keep their files 

And here is what I get:

 > hg update merging generated/file.sv 

So, I no longer receive the message "I can not find the merge tool inside: other", but it is still trying to merge the generated files.

Any ideas on how to make this work?

Additional notes:

  • We are using Mercurial version 1.7.5 because we are having problems with newer versions and subrepos.
  • I work with subrepos, here is what the structure of my main repo looks like:

enter image description here

+4
source share
1 answer

I think the problem is just a comment! Mercurial is looking for a tool called

 internal:other #keep their files 

and that hardly exists :-) Try moving the comment to the line above:

 [merge-patterns] # keep their files generated/** = internal:other 

I have not tested this, but I believe that you still need the first template that you used - the warning went away on the second attempt, because the template no longer matched internally. Even when you start a merge from the top level, subrepos merges as if hg merge running inside subrepo.

+4
source

Source: https://habr.com/ru/post/1400429/


All Articles