/usr/share/doc/monotone/html/External-Merge-Tools.html is in monotone-doc 1.0-12.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>monotone documentation: External Merge Tools</title>
<meta name="description" content="monotone documentation: External Merge Tools">
<meta name="keywords" content="monotone documentation: External Merge Tools">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="General-Index.html#General-Index" rel="index" title="General Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Hooks.html#Hooks" rel="up" title="Hooks">
<link href="Selector-Expansion.html#Selector-Expansion" rel="next" title="Selector Expansion">
<link href="External-Diff-Tools.html#External-Diff-Tools" rel="prev" title="External Diff Tools">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css" href="texinfo.css">
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="External-Merge-Tools"></a>
<div class="header">
<p>
Next: <a href="Selector-Expansion.html#Selector-Expansion" accesskey="n" rel="next">Selector Expansion</a>, Previous: <a href="External-Diff-Tools.html#External-Diff-Tools" accesskey="p" rel="prev">External Diff Tools</a>, Up: <a href="Hooks.html#Hooks" accesskey="u" rel="up">Hooks</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="General-Index.html#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="External-Merge-Tools-1"></a>
<h4 class="subsection">6.1.8 External Merge Tools</h4>
<p>These hooks allow the user to use their favorite tools when resolving
<a href="Merge-Conflicts.html#File-Content-Conflict">File Content Conflict</a>s.
</p>
<p>The <a href="Default-hooks.html#Default-hooks">Default hooks</a> include helper functions used by the hooks below
to invoke a number of external merge tools known to monotone, and you
can override or extend these hooks if you have a preferred tool, or if
you have a tool specific to certain file types.
</p>
<dl compact="compact">
<dd><a name="merge3"></a></dd>
<dt><code>merge3 (<var>ancestor_path</var>, <var>left_path</var>, <var>right_path</var>, <var>merged_path</var>, <var>ancestor_text</var>, <var>left_text</var>, <var>right_text</var>)</code>
<a name="index-merge3-_0028ancestor_005fpath_002c-left_005fpath_002c-right_005fpath_002c-merged_005fpath_002c-ancestor_005ftext_002c-left_005ftext_002c-right_005ftext_0029"></a>
</dt>
<dd>
<p>Called by <code><a href="Conflicts.html#mtn-conflicts-resolve_005ffirst">mtn conflicts resolve_first</a></code> when
<code>interactive</code> is given; by <code><a href="Tree.html#mtn-merge">mtn merge</a></code>,
<code><a href="Tree.html#mtn-explicit_005fmerge">mtn explicit_merge</a></code> when <samp>--resolve-conflicts</samp>
is not specified and the internal merger fails for a file content
conflict; and by <code><a href="Workspace.html#mtn-update">mtn update</a></code> or any command that
accepts <samp>--update</samp> for workspace file content conflicts.
</p>
<p>The actual ancestor, left, and right contents of the
file are passed in the <var>ancestor_text</var>, <var>left_text</var>, and
<var>right_text</var> strings. In addition, the hook is given the names
that this file had in the ancestor (<var>ancestor_path</var>), left
(<var>left_path</var>), and right (<var>right_path</var>) trees, and the name it
will end up having in the merged tree (<var>merged_path</var>). These
paths are useful for merge tools that can display the names of files
in their GUI, since the actual path names are likely more meaningful
than the temporary file names the merge tool will actually be working
on.
</p>
<p>On success, <code>merge3</code> returns a string, which should be the new
file contents, the result of merging the given texts. If nil is
returned, the merge command fails; this is how the user can abort a
merge.
</p>
<p>The default definition of this hook writes the texts to temporary
files, then delegates the actual merge to the result of
<a href="#get_005fpreferred_005fmerge3_005fcommand">get_preferred_merge3_command</a>. The default definition of
<a href="#get_005fpreferred_005fmerge3_005fcommand">get_preferred_merge3_command</a> checks to see if the
<code>MTN_MERGE</code> environment variable, or the Lua variable
<code>merger</code> are set to the name of a merge tool that it recognizes,
and if not, then simply searches for several popular tools that might
be installed on the local system.
</p>
<p>The default hook then invokes the merge tool, waits for it to return,
and checks to see if <var>merged_path</var> was written. If not, it returns
nil, and the merge command fails.
</p>
<p>For details, see the code in <a href="Default-hooks.html#Default-hooks">Default hooks</a>.
</p>
<p>By redefining this hook the user can choose a preferred merge tool, or
select different merge tools for different file types. For example,
gimp for .png files, OpenOffice.org for .doc, and so on.
</p>
<a name="get_005fpreferred_005fmerge3_005fcommand"></a></dd>
<dt><code>get_preferred_merge3_command(<var>tbl</var>)</code>
<a name="index-get_005fpreferred_005fmerge3_005fcommand_0028tbl_0029"></a>
</dt>
<dd>
<p>Returns a table <code>command, mkey</code> telling <code><a href="#merge3">merge3</a></code> what
external merge tool to run.
</p>
<p><var>tbl</var> wraps up the various arguments for each merge command and
is always provided by <a href="#merge3">merge3</a>. If there is a particular editor
that you would like to use to perform merge3 operations, override
this hook to specify it.
</p>
</dd>
</dl>
<hr>
<div class="header">
<p>
Next: <a href="Selector-Expansion.html#Selector-Expansion" accesskey="n" rel="next">Selector Expansion</a>, Previous: <a href="External-Diff-Tools.html#External-Diff-Tools" accesskey="p" rel="prev">External Diff Tools</a>, Up: <a href="Hooks.html#Hooks" accesskey="u" rel="up">Hooks</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="General-Index.html#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|