<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>5.1. Common Features — TortoiseHg 4.7.0 documentation</title> <link rel="stylesheet" href="_static/tortoisehg.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: './', VERSION: '4.7.0', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="top" title="TortoiseHg 4.7.0 documentation" href="index.html" /> <link rel="up" title="5. TortoiseHg in daily use" href="daily.html" /> <link rel="next" title="5.2. Windows Explorer Integration" href="explorer.html" /> <link rel="prev" title="5. TortoiseHg in daily use" href="daily.html" /> <link rel="stylesheet" href="_static/custom.css" type="text/css" /> <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" /> </head> <body role="document"> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <div class="section" id="module-common.dialog"> <span id="common-features"></span><h1>5.1. Common Features<a class="headerlink" href="#module-common.dialog" title="Permalink to this headline">¶</a></h1> <p>These features are common to many TortoiseHg tools, so we document them here just once.</p> <div class="section" id="visual-diffs"> <h2>5.1.1. Visual Diffs<a class="headerlink" href="#visual-diffs" title="Permalink to this headline">¶</a></h2> <div class="figure" id="id1"> <img alt="Visual Diff Window" src="_images/visual-diff.jpg" /> <p class="caption"><span class="caption-text">Visual Diff Window</span></p> </div> <p>In TortoiseHg 1.0, the visual (external) diff infrastructure was refactored. The new system uses tool descriptions in <code class="file docutils literal"><span class="pre">mergetools.rc</span></code> to detect most common diff tools on your computer (including KDiff3, which ships in our installer) and select the best available tool.</p> <p>If the user has selected a merge tool (<span class="menuselection">TortoiseHg ‣ Three-way Merge Tool</span>), that tool will also be used to perform visual diffs, bypassing the tool selection process. However the user can still select a separate tool (<span class="menuselection">TortoiseHg ‣ Visual Diff Tool</span>) for visual diffs if they chose.</p> <p>The merge tool configuration file contains optimal command lines for each tool, so no further configuration is required by the user. They only need to select the tools they wish use, or accept the defaults.</p> <p>The visual diff system will use any existing extdiff configuration it finds. Since extdiff did not support three way diff arguments until very recently and still does not support label arguments, you will likely have a better experience by disabling or deleting any extdiff configuration you may have.</p> <p>The visual diff system will directly use the selected diff tool unless the action you are attempting requires the use of the TortoiseHg visual diff window. The list of conditions includes:</p> <ol class="arabic simple"> <li>The selection of files being compared require multiple tools</li> <li>The selected tool forks detached background processes</li> <li>The selected tool does not support the required directory diffs</li> <li>The selected tool does not support three way comparisons</li> <li>The file changes include renames or copies</li> </ol> <p>When the visual diff window is used, the temporary files are cleaned up when the dialog is closed. Thus it should be left open until you close all of your diff tool instances. When your diff tool is launched directly, the temporary files are deleted when your tool exits.</p> <p>If your diff tool is launched directly to compare a working copy file, it will directly diff against the working file so you may modify it from within the diff tool. If you are comparing multiple files, the visual diff system will make a snapshot of the working copy files and track their initial sizes and timestamps. When your diff tool exits, the system compares the sizes and timestamps and copies modified files back over the original working copies. In this way, you can still modify your working copy files from your visual diff tool even when performing directory comparisons.</p> <p>When the visual diff window is used to compare working copy files, it always directly diffs against the working copy files since it always operates on a single file at a time.</p> <div class="deprecated"> <p><span class="versionmodified">Deprecated since version 1.0: </span>The <span class="menuselection">TortoiseHg ‣ Skip Diff Window</span> configurable has been removed because it is now redundant.</p> </div> <div class="section" id="adding-tools"> <h3>5.1.1.1. Adding Tools<a class="headerlink" href="#adding-tools" title="Permalink to this headline">¶</a></h3> <p>If you have a visual diff tool installed that is not supported by TortoiseHg, you can create a tool configuration for it in your user <code class="file docutils literal"><span class="pre">Mercurial.ini</span></code> file. See Mercurial’s <a class="reference external" href="https://www.mercurial-scm.org/doc/hgrc.5.html#merge-tools">documentation</a> on how to configure your tool for use in file merges. When that is complete, you can add the extra keys used by TortoiseHg for visual diff:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">diffargs</span><span class="p">:</span> <span class="n">the</span> <span class="n">arguments</span> <span class="n">to</span> <span class="n">use</span> <span class="k">for</span> <span class="n">two</span><span class="o">-</span><span class="n">way</span> <span class="n">file</span> <span class="n">comparisons</span> <span class="n">diff3args</span><span class="p">:</span> <span class="n">the</span> <span class="n">arguments</span> <span class="n">to</span> <span class="n">use</span> <span class="k">for</span> <span class="n">three</span><span class="o">-</span><span class="n">way</span> <span class="n">file</span> <span class="n">comparisons</span> <span class="n">dirdiff</span><span class="p">:</span> <span class="n">this</span> <span class="n">tool</span> <span class="n">supports</span> <span class="n">two</span><span class="o">-</span><span class="n">way</span> <span class="n">directory</span> <span class="n">comparisons</span> <span class="n">dir3diff</span><span class="p">:</span> <span class="n">this</span> <span class="n">tool</span> <span class="n">supports</span> <span class="n">three</span><span class="o">-</span><span class="n">way</span> <span class="n">directory</span> <span class="n">comparisons</span> </pre></div> </div> <p>When building command line arguments, you can use the following variables:</p> <div class="highlight-default"><div class="highlight"><pre><span></span>$parent1: the file or directory from the first parent revision $parent2: the file or directory from the second parent revision $child: the file or directory from the revision being compared $parent: a synonym for $parent1 $plabel1: a symbolic name for the first parent revision $plabel2: a symbolic name for the second parent revision $clabel: a symbolic name for the revision being compared </pre></div> </div> <p>Obviously, $parent2 and $ancestor are only meaningful when used in three way diff arguments, for viewing merge changesets. If your diff tool cannot use the ancestor revision in any productive way, it is safe to leave it out of the diff3args command line.</p> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">On Windows, the <cite>executable</cite> parameter can use environment variables using the syntax ${ProgramFiles}</p> </div> <p>If unconfigured, the default value of <strong>diffargs</strong> is ‘$parent $child’. The default value of <strong>diff3args</strong> is “”, indicating the visual diff tool cannot perform three way comparisons.</p> <p>If you create a new visual diff tool configuration, or improve upon an existing configuration, please email it to our development mailing list so it may be incorporated in a future release.</p> </div> <div class="section" id="word-diffs"> <h3>5.1.1.2. Word Diffs<a class="headerlink" href="#word-diffs" title="Permalink to this headline">¶</a></h3> <p>The TortoiseHg Windows installers now include TortoiseSVN’s scripts for comparing (and sometimes merging) many binary document formats. These are configured in the site-wide <code class="file docutils literal"><span class="pre">mergepatterns.rc</span></code> as handlers for each binary format’s common file extensions, so no user intervention is required.</p> <p>In order to support file extension based tool selection, TortoiseHg has added support for a <strong>[diff-patterns]</strong> section equivalent to Mercurial’s <a class="reference external" href="https://www.mercurial-scm.org/doc/hgrc.5.html#merge-patterns">merge-patterns</a> section.</p> </div> </div> </div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <p class="logo"><a href="index.html"> <img class="logo" src="_static/thg_logo_92x50.png" alt="Logo"/> </a></p> <h3><a href="index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">5.1. Common Features</a><ul> <li><a class="reference internal" href="#visual-diffs">5.1.1. Visual Diffs</a><ul> <li><a class="reference internal" href="#adding-tools">5.1.1.1. Adding Tools</a></li> <li><a class="reference internal" href="#word-diffs">5.1.1.2. Word Diffs</a></li> </ul> </li> </ul> </li> </ul> <div class="relations"> <h3>Related Topics</h3> <ul> <li><a href="index.html">Documentation overview</a><ul> <li><a href="daily.html">5. TortoiseHg in daily use</a><ul> <li>Previous: <a href="daily.html" title="previous chapter">5. TortoiseHg in daily use</a></li> <li>Next: <a href="explorer.html" title="next chapter">5.2. Windows Explorer Integration</a></li> </ul></li> </ul></li> </ul> </div> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="_sources/common.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3>Quick search</h3> <form class="search" action="search.html" method="get"> <div><input type="text" name="q" /></div> <div><input type="submit" value="Go" /></div> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="footer"> ©2010-2018, Steve Borho and others. | Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.9</a> & <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a> | <a href="_sources/common.txt" rel="nofollow">Page source</a> </div> </body> </html>