<!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>9. Use with other VCS systems — 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="next" title="10. Frequently Asked Questions" href="faq.html" /> <link rel="prev" title="8. Extensions" href="extensions.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-nonhg"> <span id="use-with-other-vcs-systems"></span><h1>9. Use with other VCS systems<a class="headerlink" href="#module-nonhg" title="Permalink to this headline">¶</a></h1> <p>This chapter describes the three most popular Mercurial extensions for interoperating with <em>foreign</em> VCS systems. See also <a class="reference external" href="https://www.mercurial-scm.org/wiki/RepositoryConversion">Repository Conversion</a></p> <div class="section" id="perfarce-perforce"> <span id="id1"></span><h2>9.1. Perfarce (Perforce)<a class="headerlink" href="#perfarce-perforce" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li><a class="reference external" href="http://www.kingswood-consulting.co.uk/hg/perfarce/">Perfarce</a> home page.</li> <li><a class="reference external" href="https://www.mercurial-scm.org/wiki/PerforceConcepts">Mercurial for Perforce users</a></li> </ul> <p>This extension modifies the remote repository handling so that repository paths that resemble:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">p4</span><span class="p">:</span><span class="o">//</span><span class="n">p4server</span><span class="p">[:</span><span class="n">port</span><span class="p">]</span><span class="o">/</span><span class="n">clientname</span> </pre></div> </div> <p>cause operations on the named p4 client specification on the p4 server. The client specification must already exist on the server before using this extension. Making changes to the client specification Views causes problems when synchronizing the repositories, and should be avoided.</p> <p>Five built-in Mercurial commands are overridden.</p> <p>outgoing:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">If</span> <span class="n">the</span> <span class="n">destination</span> <span class="n">repository</span> <span class="n">name</span> <span class="n">starts</span> <span class="k">with</span> <span class="n">p4</span><span class="p">:</span><span class="o">//</span> <span class="n">then</span> <span class="n">this</span> <span class="n">reports</span> <span class="n">files</span> <span class="n">affected</span> <span class="n">by</span> <span class="n">the</span> <span class="n">revision</span><span class="p">(</span><span class="n">s</span><span class="p">)</span> <span class="n">that</span> <span class="n">are</span> <span class="ow">in</span> <span class="n">the</span> <span class="n">local</span> <span class="n">repository</span> <span class="n">but</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">the</span> <span class="n">p4</span> <span class="n">depot</span><span class="o">.</span> </pre></div> </div> <p>push:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">If</span> <span class="n">the</span> <span class="n">destination</span> <span class="n">repository</span> <span class="n">name</span> <span class="n">starts</span> <span class="k">with</span> <span class="n">p4</span><span class="p">:</span><span class="o">//</span> <span class="n">then</span> <span class="n">this</span> <span class="n">exports</span> <span class="n">changes</span> <span class="kn">from</span> <span class="nn">the</span> <span class="n">local</span> <span class="n">repository</span> <span class="n">to</span> <span class="n">the</span> <span class="n">p4</span> <span class="n">depot</span><span class="o">.</span> <span class="n">If</span> <span class="n">no</span> <span class="n">revision</span> <span class="ow">is</span> <span class="n">specified</span> <span class="n">then</span> <span class="nb">all</span> <span class="n">changes</span> <span class="n">since</span> <span class="n">the</span> <span class="n">last</span> <span class="n">p4</span> <span class="n">changelist</span> <span class="n">are</span> <span class="n">pushed</span><span class="o">.</span> <span class="n">In</span> <span class="n">either</span> <span class="n">case</span><span class="p">,</span> <span class="nb">all</span> <span class="n">revisions</span> <span class="n">to</span> <span class="n">be</span> <span class="n">pushed</span> <span class="n">are</span> <span class="n">foled</span> <span class="n">into</span> <span class="n">a</span> <span class="n">single</span> <span class="n">p4</span> <span class="n">changelist</span><span class="o">.</span> <span class="n">Optionally</span> <span class="n">the</span> <span class="n">resulting</span> <span class="n">changelist</span> <span class="ow">is</span> <span class="n">submitted</span> <span class="n">to</span> <span class="n">the</span> <span class="n">p4</span> <span class="n">server</span><span class="p">,</span> <span class="n">controlled</span> <span class="n">by</span> <span class="n">the</span> <span class="o">--</span><span class="n">submit</span> <span class="n">option</span> <span class="n">to</span> <span class="n">push</span><span class="p">,</span> <span class="ow">or</span> <span class="n">by</span> <span class="n">setting</span> <span class="o">**</span><span class="n">perfarce</span><span class="o">.</span><span class="n">submit</span><span class="o">**</span> <span class="n">to</span> <span class="kc">True</span><span class="o">.</span> <span class="n">If</span> <span class="n">the</span> <span class="n">option</span> <span class="o">**</span><span class="n">perfarce</span><span class="o">.</span><span class="n">keep</span><span class="o">**</span> <span class="ow">is</span> <span class="kc">False</span> <span class="n">then</span> <span class="n">after</span> <span class="n">a</span> <span class="n">successful</span> <span class="n">submit</span> <span class="n">the</span> <span class="n">files</span> <span class="ow">in</span> <span class="n">the</span> <span class="n">p4</span> <span class="n">workarea</span> <span class="n">will</span> <span class="n">be</span> <span class="n">deleted</span><span class="o">.</span> </pre></div> </div> <p>pull:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">If</span> <span class="n">the</span> <span class="n">source</span> <span class="n">repository</span> <span class="n">name</span> <span class="n">starts</span> <span class="k">with</span> <span class="n">p4</span><span class="p">:</span><span class="o">//</span> <span class="n">then</span> <span class="n">this</span> <span class="n">imports</span> <span class="n">changes</span> <span class="kn">from</span> <span class="nn">the</span> <span class="n">p4</span> <span class="n">depot</span><span class="p">,</span> <span class="n">automatically</span> <span class="n">creating</span> <span class="n">merges</span> <span class="n">of</span> <span class="n">changelists</span> <span class="n">submitted</span> <span class="n">by</span> <span class="n">hg</span> <span class="n">push</span><span class="o">.</span> <span class="n">If</span> <span class="n">the</span> <span class="n">config</span> <span class="n">option</span> <span class="o">**</span><span class="n">perfarce</span><span class="o">.</span><span class="n">keep</span><span class="o">**</span> <span class="ow">is</span> <span class="kc">False</span> <span class="n">then</span> <span class="n">the</span> <span class="kn">import</span> <span class="nn">does</span> <span class="ow">not</span> <span class="n">leave</span> <span class="n">files</span> <span class="ow">in</span> <span class="n">the</span> <span class="n">p4</span> <span class="n">workarea</span><span class="p">,</span> <span class="n">otherwise</span> <span class="n">the</span> <span class="n">p4</span> <span class="n">workarea</span> <span class="n">will</span> <span class="n">be</span> <span class="n">updated</span> <span class="k">with</span> <span class="n">the</span> <span class="n">new</span> <span class="n">files</span><span class="o">.</span> </pre></div> </div> <p>incoming:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">If</span> <span class="n">the</span> <span class="n">source</span> <span class="n">repository</span> <span class="n">name</span> <span class="n">starts</span> <span class="k">with</span> <span class="n">p4</span><span class="p">:</span><span class="o">//</span> <span class="n">then</span> <span class="n">this</span> <span class="n">reports</span> <span class="n">changes</span> <span class="ow">in</span> <span class="n">the</span> <span class="n">p4</span> <span class="n">depot</span> <span class="n">that</span> <span class="n">are</span> <span class="ow">not</span> <span class="n">yet</span> <span class="ow">in</span> <span class="n">the</span> <span class="n">local</span> <span class="n">repository</span><span class="o">.</span> </pre></div> </div> <p>clone:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">If</span> <span class="n">the</span> <span class="n">source</span> <span class="n">repository</span> <span class="n">name</span> <span class="n">starts</span> <span class="k">with</span> <span class="n">p4</span><span class="p">:</span><span class="o">//</span> <span class="n">then</span> <span class="n">this</span> <span class="n">creates</span> <span class="n">the</span> <span class="n">destination</span> <span class="n">repository</span> <span class="ow">and</span> <span class="n">pulls</span> <span class="nb">all</span> <span class="n">changes</span> <span class="kn">from</span> <span class="nn">the</span> <span class="n">p4</span> <span class="n">depot</span> <span class="n">into</span> <span class="n">it</span><span class="o">.</span> </pre></div> </div> <p>The <strong>perfarce.tags</strong> configuration option determines whether perfarce tries to import Perforce labels as Mercurial tags.</p> <p><em>TortoiseHg Integration</em></p> <p>When the perfarce extension is enabled, it adds a <span class="guilabel">start revision</span> configurable option to the clone tool, and a <span class="guilabel">P4</span> toolbar button to the sync tool.</p> <p>The toolbar button performs the p4pending operation. It detects pending Perforce changelists that have been “push”ed to your Perforce client but have not been submitted, or have not been pulled back. This opens the pending changelist dialog so that you can view these pending changelists and either submit or revert them. If Perforce fails the submit because your files are out of date, you must revert the changelist, pull from Perforce, merge, then push again.</p> <p><em>Installation</em></p> <p>Perfarce comes bundled with TortoiseHg Windows installers, so you enable perfarce by simply adding it to your Mercurial.ini or a repository’s hgrc like this:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">extensions</span><span class="p">]</span> <span class="n">perfarce</span><span class="o">=</span> </pre></div> </div> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">The perfarce extension has been known to not work together with hgsubversion, so if you plan to use both extensions they should be enabled locally on the repositories that require them.</p> </div> </div> <div class="section" id="hgsubversion-svn"> <h2>9.2. hgsubversion (SVN)<a class="headerlink" href="#hgsubversion-svn" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li><a class="reference external" href="https://bitbucket.org/durin42/hgsubversion/wiki/Home">hgsubversion</a> home page</li> <li><a class="reference external" href="https://www.mercurial-scm.org/wiki/HgSubversion">hgsubversion Extension</a> wiki page</li> <li><a class="reference external" href="https://www.mercurial-scm.org/wiki/WorkingWithSubversion">Working with Subversion Repositories</a></li> </ul> <p>hgsubversion, as it’s name implies, allows you to use Mercurial as a client to a Subversion server. It can also be used to do straight conversions of Subversion repositories into Mercurial.</p> <p><em>Installation</em></p> <p>TortoiseHg Windows installers up to and including version 3.3.3 come with the python-svn bindings and hgsubversion included. Users of these versions can enable the hgsubversion extensions via the settings tool or manually:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">extensions</span><span class="p">]</span> <span class="n">hgsubversion</span> <span class="o">=</span> </pre></div> </div> <p>You can verify that worked by typing <strong class="command">hg help hgsubversion</strong></p> <p>Beginning with release 3.4 of TortoiseHg, the subversion libraries and the Python 2.7 SWIG bindings for them have been removed from the TortoiseHg packages. This was done primarily because of security problems in the subversion DLLs that we as TortoiseHg maintainers have no control over, but also to avoid having to package a second complete revision control system (SVN) in every copy of TortoiseHg (and the major headaches these bindings have become).</p> <p>The python SWIG bindings are now provided as separate download. Instructions to download and use the python SWIG bindings is available at <a class="reference external" href="https://bitbucket.org/tortoisehg/thg/wiki/libsvn">Subversion bindings for Python 2.7</a>.</p> <p>See the hgsubversion wiki for details of use. We recommend an hgsubversion version of at least 1.2.1 with Mercurial 1.8.</p> <div class="admonition warning"> <p class="first admonition-title">Warning</p> <p class="last">When cloning a Subversion server, it is highly recommended to clone only the first few revisions then pull the rest. The failure behavior of the clone command is to delete the incomplete clone, while pull is much more forgiving.</p> </div> <p><em>TortoiseHg Integration</em></p> <p>Imported Subversion changesets will display the original Subversion checkin number in the Changeset Info widget in the Revision Details task tab of the Workbench.</p> </div> <div class="section" id="hg-git-git"> <h2>9.3. hg-git (git)<a class="headerlink" href="#hg-git-git" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li><a class="reference external" href="https://hg-git.github.io/">hg-git</a> home page</li> <li><a class="reference external" href="https://www.mercurial-scm.org/wiki/HgGit">hg-git Extension</a> wiki page</li> <li><a class="reference external" href="https://www.mercurial-scm.org/wiki/GitConcepts">Mercurial for Git users</a></li> </ul> <p>hg-git, as its name implies, allows you to use Mercurial as a client to a git server. It can also be used to do straight conversions of Git repositories into Mercurial.</p> <p><em>Installation</em></p> <p>TortoiseHg Windows installers come with the python-git bindings (named dulwich) and hg-git. It can be enabled via the settings tool or manually:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">extensions</span><span class="p">]</span> <span class="n">hggit</span> <span class="o">=</span> </pre></div> </div> <p>You can verify that worked by typing <strong class="command">hg help hggit</strong></p> <p>See the hggit documentation for details of use.</p> <p>Beware the ‘incoming’ command appears broken when speaking with git repositories, and ‘outgoing’ does not show much useful info. So you are restricted to simple push and pull commands, which is common with Mercurial extensions that speak to external revision control tools.</p> </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="#">9. Use with other VCS systems</a><ul> <li><a class="reference internal" href="#perfarce-perforce">9.1. Perfarce (Perforce)</a></li> <li><a class="reference internal" href="#hgsubversion-svn">9.2. hgsubversion (SVN)</a></li> <li><a class="reference internal" href="#hg-git-git">9.3. hg-git (git)</a></li> </ul> </li> </ul> <div class="relations"> <h3>Related Topics</h3> <ul> <li><a href="index.html">Documentation overview</a><ul> <li>Previous: <a href="extensions.html" title="previous chapter">8. Extensions</a></li> <li>Next: <a href="faq.html" title="next chapter">10. Frequently Asked Questions</a></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/nonhg.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/nonhg.txt" rel="nofollow">Page source</a> </div> </body> </html>