Support for more lines of context in hg merge?

Bryan Murdock bmurdock at gmail.com
Fri Sep 23 19:33:34 UTC 2016


On Sep 23, 2016 12:04 PM, "Daniel Faken" <dfaken at coventor.com> wrote:
>
> Hello all,
>
>   I recently encountered a problem where the Hg automerge inserted some
duplicate code into the file.
>
>   Basically the inputs were like this:
>
>   ..long stretch of identical code..
>   ..line A of identical code except for a change in a function name..
>   ..two lines of identical code..
>   ..line B of identical code except for a change in a function name..
>   ..block of identical code..
>  ..long stretch of identical code..
>
>   and the result of automerge was that line A and B are merged properly,
but the 'block of identical code' gets duplicated.
>
>   It appears this is due to some complex revision history [partly
involving changes to the 'block of identical code'] since the problem
doesn't occur if I get rid of the history.
>
>   I can't post the code here, but it appears that a similar situation is
described at
http://stackoverflow.com/questions/5003577/how-safe-are-automatic-merges-in-mercurial
>
>   In that Stackoverflow discussion it mentions that the _default_ context
is three lines wide, and I'm thinking that our problems might be lessened
with more context.  (though i realize we might get more prompts for manual
merges as well)
>
>   So my question: is there some way to specify an increased number of
lines to use for context?
>
>   The only option I could find was for the diff tool, but the help
explicitly says this is only for the diff tool.

This is not a good answer to your question.  Is your heart set on not using
a graphical merge tool?  kdiff3 is a really helpful tool.

Bryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20160923/8271b0a2/attachment-0002.html>


More information about the Mercurial mailing list