Patchwork [1,of,6] help: describe more detail about capabilities while deciding merge tool

login
register
mail settings
Submitter Katsunori FUJIWARA
Date Aug. 15, 2018, 6:35 p.m.
Message ID <cffd12b0d927a859e99c.1534358133@blacknile>
Download mbox | patch
Permalink /patch/33744/
State Accepted
Headers show

Comments

Katsunori FUJIWARA - Aug. 15, 2018, 6:35 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1534244736 -32400
#      Tue Aug 14 20:05:36 2018 +0900
# Node ID cffd12b0d927a859e99c8b5e3f451512c85999d1
# Parent  18cbe2d872d3184c4504094a6fd070ca96f48181
# Available At https://bitbucket.org/foozy/mercurial-wip
#              hg pull https://bitbucket.org/foozy/mercurial-wip -r cffd12b0d927
# EXP-Topic filemerge-refactor
help: describe more detail about capabilities while deciding merge tool

"hg help merge-tools" describes as below:

    (internal merge tools) will by default not handle symlinks or
    binary files.

But in some cases, Mercurial assumes that internal merge tools have
one or both of these capabilities.

"hg help merge-tools" also describes as below, for matching patterns in
merge-patterns configuration section. But this is not sufficient.

    Here, binary capabilities of the merge tool are not considered.

This patch describes more detail about capabilities while deciding
merge tool.
Yuya Nishihara - Aug. 16, 2018, 10:32 a.m.
On Thu, 16 Aug 2018 03:35:33 +0900, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
> # Date 1534244736 -32400
> #      Tue Aug 14 20:05:36 2018 +0900
> # Node ID cffd12b0d927a859e99c8b5e3f451512c85999d1
> # Parent  18cbe2d872d3184c4504094a6fd070ca96f48181
> # Available At https://bitbucket.org/foozy/mercurial-wip
> #              hg pull https://bitbucket.org/foozy/mercurial-wip -r cffd12b0d927
> # EXP-Topic filemerge-refactor
> help: describe more detail about capabilities while deciding merge tool

Queued the series, thanks.

> +For historical reason, Mercurial assumes capabilities of internal
> +merge tools as below while examining rules above, regardless of actual
> +capabilities of them.
> +
> +==== =============== ====== =======
> +step specified via   binary symlink
> +==== =============== ====== =======
> +1.   --tool          o      o
> +2.   HGMERGE         o      o
> +3.   merge-patterns  o      x
> +4.   ui.merge        x      x
> +==== =============== ====== =======

I'm not sure if I understand this table.

 "o" = capability is NOT checked
 "x" = capability is checked

Is that correct?
Katsunori FUJIWARA - Aug. 16, 2018, 2:08 p.m.
At Thu, 16 Aug 2018 19:32:23 +0900,
Yuya Nishihara wrote:
> 
> On Thu, 16 Aug 2018 03:35:33 +0900, FUJIWARA Katsunori wrote:
> > # HG changeset patch
> > # User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
> > # Date 1534244736 -32400
> > #      Tue Aug 14 20:05:36 2018 +0900
> > # Node ID cffd12b0d927a859e99c8b5e3f451512c85999d1
> > # Parent  18cbe2d872d3184c4504094a6fd070ca96f48181
> > # Available At https://bitbucket.org/foozy/mercurial-wip
> > #              hg pull https://bitbucket.org/foozy/mercurial-wip -r cffd12b0d927
> > # EXP-Topic filemerge-refactor
> > help: describe more detail about capabilities while deciding merge tool
> 
> Queued the series, thanks.
> 
> > +For historical reason, Mercurial assumes capabilities of internal
> > +merge tools as below while examining rules above, regardless of actual
> > +capabilities of them.
> > +
> > +==== =============== ====== =======
> > +step specified via   binary symlink
> > +==== =============== ====== =======
> > +1.   --tool          o      o
> > +2.   HGMERGE         o      o
> > +3.   merge-patterns  o      x
> > +4.   ui.merge        x      x
> > +==== =============== ====== =======
> 
> I'm not sure if I understand this table.
> 
>  "o" = capability is NOT checked
>  "x" = capability is checked
> 
> Is that correct?

No, Mercurial assumes:

  "o" = has capability
  "x" = does not have capability

I'll resend to revise description for understandability.

Patch

diff --git a/mercurial/help/merge-tools.txt b/mercurial/help/merge-tools.txt
--- a/mercurial/help/merge-tools.txt
+++ b/mercurial/help/merge-tools.txt
@@ -54,8 +54,7 @@  2. If the ``HGMERGE`` environment variab
 
 3. If the filename of the file to be merged matches any of the patterns in the
    merge-patterns configuration section, the first usable merge tool
-   corresponding to a matching pattern is used. Here, binary capabilities of the
-   merge tool are not considered.
+   corresponding to a matching pattern is used.
 
 4. If ui.merge is set it will be considered next. If the value is not the name
    of a configured tool, the specified value is used and must be executable by
@@ -72,6 +71,19 @@  7. If the file to be merged is not binar
 
 8. Otherwise, ``:prompt`` is used.
 
+For historical reason, Mercurial assumes capabilities of internal
+merge tools as below while examining rules above, regardless of actual
+capabilities of them.
+
+==== =============== ====== =======
+step specified via   binary symlink
+==== =============== ====== =======
+1.   --tool          o      o
+2.   HGMERGE         o      o
+3.   merge-patterns  o      x
+4.   ui.merge        x      x
+==== =============== ====== =======
+
 .. note::
 
    After selecting a merge program, Mercurial will by default attempt
diff --git a/tests/test-help.t b/tests/test-help.t
--- a/tests/test-help.t
+++ b/tests/test-help.t
@@ -1892,8 +1892,7 @@  Test dynamic list of merge tools only sh
          must be executable by the shell.
       3. If the filename of the file to be merged matches any of the patterns in
          the merge-patterns configuration section, the first usable merge tool
-         corresponding to a matching pattern is used. Here, binary capabilities
-         of the merge tool are not considered.
+         corresponding to a matching pattern is used.
       4. If ui.merge is set it will be considered next. If the value is not the
          name of a configured tool, the specified value is used and must be
          executable by the shell. Otherwise the named tool is used if it is
@@ -1906,6 +1905,17 @@  Test dynamic list of merge tools only sh
          internal ":merge" is used.
       8. Otherwise, ":prompt" is used.
   
+      For historical reason, Mercurial assumes capabilities of internal merge
+      tools as below while examining rules above, regardless of actual
+      capabilities of them.
+  
+      step specified via  binary symlink
+      ----------------------------------
+      1.   --tool         o      o
+      2.   HGMERGE        o      o
+      3.   merge-patterns o      x
+      4.   ui.merge       x      x
+  
       Note:
          After selecting a merge program, Mercurial will by default attempt to
          merge the files using a simple merge algorithm first. Only if it