1. Takayuki KONDO
  2. cointoss1973.bitbucket.org


cointoss1973.bitbucket.org / thg / manual / 2.4 / sync.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<html xmlns="http://www.w3.org/1999/xhtml">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>5.9. Synchronize &mdash; TortoiseHg 2.4.0 documentation</title>
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript">
        URL_ROOT:    '',
        VERSION:     '2.4.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
    <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="top" title="TortoiseHg 2.4.0 documentation" href="index.html" />
    <link rel="up" title="5. TortoiseHg in daily use" href="daily.html" />
    <link rel="next" title="5.10. Serve" href="serve.html" />
    <link rel="prev" title="5.8. Shelve" href="shelve.html" /> 
    <div class="related">
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="serve.html" title="5.10. Serve"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="shelve.html" title="5.8. Shelve"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">TortoiseHg 2.4.0 documentation</a> &raquo;</li>
          <li><a href="daily.html" accesskey="U">5. TortoiseHg in daily use</a> &raquo;</li> 

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
  <div class="section" id="module-synchronize.dialog">
<span id="synchronize"></span><h1>5.9. Synchronize<a class="headerlink" href="#module-synchronize.dialog" title="Permalink to this headline"></a></h1>
<div class="figure">
<img alt="Synchronize dialog" src="_images/synchronize.png" />
<p class="caption">Synchronize dialog</p>
<p>The synchronize tool is used to transmit changesets between repositories
or to email recipients.</p>
<div><dl class="docutils">
<dt><em class="guilabel">Incoming</em></dt>
<dd>show changesets that would be pulled from target repository, the
changes in the target repository that are not in local repository</dd>
<dt><em class="guilabel">Pull</em></dt>
<dd>pull incoming changesets from target repository</dd>
<dt><em class="guilabel">Outgoing</em></dt>
<dd>show changesets that would be pushed to target repository, the
changes in the local repository that are not in target
<dt><em class="guilabel">Push</em></dt>
<dd>push outgoing changesets to target repository, make the local
<em>tip</em> the new <em>tip</em> in the target repository</dd>
<dt><em class="guilabel">Email</em></dt>
<dd>send outgoing changesets (to target repository) as email</dd>
<dt><em class="guilabel">Stop</em></dt>
<dd>stop current operation</dd>
<p>The <em class="guilabel">Post Pull</em> dialog contains radio buttons for selecting
the operation which is performed after a pull.  If you open the
configuration tool, you can select a default behavior for your user
account and override that selection on a per-repository basis.</p>
<div><dl class="docutils">
<dt><em class="guilabel">None</em></dt>
<dd>No operations are performed after a pull.  You will be allowed to
view the pulled changesets in the log viewer, and you will have the
option to update to the new tip if applicable.</dd>
<dt><em class="guilabel">Update</em></dt>
<dd>Automatically update to the current branch tip if, and only if, new
revisions were pulled into the local repository.  This could trigger
a merge if the pulled changes conflict with local uncommitted
<dt><em class="guilabel">Fetch</em></dt>
<dd>Equivalent to hg fetch.  See the fetch extension documentation for
its behavior.  This feature is only available if the fetch
extension has been enabled by the user.</dd>
<dt><em class="guilabel">Rebase</em></dt>
<dd>Equivalent to pull &#8211;rebase.  See the rebase extension
documentation for its behavior.  This feature is only available
if the rebase extension has been enabled by the user.</dd>
<dt><em class="guilabel">Automatically resolve merge conflicts where possible</em></dt>
<dd>If update or rebase are selected, a pull operation may result in
a merge.  If checked, Mercurial will try to resolve trivial
merge conflicts without user interaction.  If not checked, all
merges will be interactive.</dd>
<p>The <em class="guilabel">Options</em> dialog provides checkboxes for selecting
infrequently used command options.</p>
<div><dl class="docutils">
<dt><em class="guilabel">Allow push of a new branch</em></dt>
<dd>allow a new named branch to be pushed</dd>
<dt><em class="guilabel">Force pull or push</em></dt>
<dd>override warnings about multiple heads or unrelated repositories</dd>
<dt><em class="guilabel">Recurse into subdirectories</em></dt>
<dd>incoming or outgoing commands can recurse into subdirectories
and provide a full report</dd>
<dt><em class="guilabel">Temporarily disable configured proxy</em></dt>
<dd>only sensitive when a web proxy is configured for the given
repository.  While checked it will disable that proxy.</dd>
<dt><em class="guilabel">Remote Command</em></dt>
<dd>provides a &#8211;remotecmd argument</dd>
<p>When the sync tool is opened within the Workbench, the toolbar has a
<em class="guilabel">Target</em> checkbox.  While checked, the target dropdown box is
sensitive and the selected target revision, bookmark, or branch will be
added to every synchronization command.  When the sync tool is opened
outside of the Workbench, the target checkbox and dropdown box is
hidden.  Clicking on a revision in the graph will update the values in
the dropdown box.  Holding <tt class="kbd docutils literal"><span class="pre">Alt</span></tt> while clicking on a revision will
select the revision without switching away from the sync tool tab.</p>
<p>Below the toolbar is the currently selected URL.  All synchronization
commands will use this URL.  The general effect of the toolbar is that
it can be read as a Mercurial command line.  The tool buttons select the
command, the <em class="guilabel">Post Pull</em> and <em class="guilabel">Options</em> dialog
specify options, the target dropdown box can specify revisions, and
finally the URL completes the command.</p>
<div class="section" id="adding-an-url">
<h2>5.9.1. Adding an URL<a class="headerlink" href="#adding-an-url" title="Permalink to this headline"></a></h2>
<p>By far the easiest way to add a new URL to your respository is to drag
and drop the URL from another application, then press the save button
and provide the URL an alias.</p>
<p>The two list panes display URLs that are stored in the current
repository&#8217;s configuration file (<em class="guilabel">Stored Paths</em>) and URLs that are
stored in other related repositories that are listed in the Workbench
repository registry (<em class="guilabel">Related Paths</em>).  When the sync tool is opened
outside of the Workbench, the <em class="guilabel">Related Paths</em> list will be empty.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Being related means two repositories share at least a common root
changeset.  Cloned are obviously related.  Push and pull operations
require that repositories to be related, or that you use &#8211;force to
override the relationship check.</p>
<p>The URL lists have a context menu that allows you to browse, open a
terminal, or delete an URL from your local configuration file.  The
platform standard delete key sequence will also remove an URL.</p>
<div class="section" id="security">
<h2>5.9.2. Security<a class="headerlink" href="#security" title="Permalink to this headline"></a></h2>
<p>Mercurial (and TortoiseHg) support two secure protocols for exchanging
data with remove servers.  HTTPS (SSL) and SSH.</p>
<div class="section" id="https">
<h3> HTTPS<a class="headerlink" href="#https" title="Permalink to this headline"></a></h3>
<p>There are two asymmetrical parts to a secure HTTPS connection.  The
first part of the secure connection is authenticating the identification
of the server.  The second is authenticating yourself (the client) to
the server, either via a username and passphrase or a certificate key.</p>
<div class="section" id="host-authentication">
<h4> Host Authentication<a class="headerlink" href="#host-authentication" title="Permalink to this headline"></a></h4>
<p>Prior to version 1.7, Mercurial ignored this half of HTTPS connection
security.  In version 1.7 it began warning that the server&#8217;s certificate
was not being verified.  Starting with Mercurial version 1.7.3
(TortoiseHG 1.1.7), the binary installers begain to include a CA
certificate file so that HTTPS server certificates could be verified by
the standard certificate authorities.  We download our certificate
authority file from <a class="reference external" href="http://curl.haxx.se/ca/cacert.pem">http://curl.haxx.se/ca/cacert.pem</a>.</p>
<p>Mercurial version 1.7.5 introduced the ability to validate an HTTPS
server&#8217;s certificate against a stored fingerprint.  TortoiseHg 2.0&#8217;s
synchronize tool has an HTTPS security dialog that allows you to select
between using a host fingerprint or using the CA certificates.</p>
<p>In theory, a host fingerprint is more secure than the CA certificates
if you do not necessarily trust all of the signing authorities listed in
the cacert.pem file.  However you must be sure that the fingerprint you
store is the correct fingerprint for the server to which you believe you
are communicating.</p>
<p>TortoiseHg 2.0 also allows you to select an insecure connection for a
given host.  This disables validation of the host&#8217;s certificate but
still uses an encrypted data stream (which was essentially the behavior
of Mercurial pre-1.7 except for the warning messages).</p>
<div class="section" id="user-authentication">
<h4> User Authentication<a class="headerlink" href="#user-authentication" title="Permalink to this headline"></a></h4>
<p>There are several mechanisms available for authenticating yourself to an
HTTPS server.  The simplest is to allow Mercurial to prompt you for the
username and passphrase.  However this quickly grows old as the two
prompts are always made separately and each push operation can require
multiple connections to be established.</p>
<p>The next option is to encode the username in the URL so that Mercurial
only prompts for a passphrase.  This cuts the number of prompts in half,
but is still annoying.  If you do not wish to be prompted for the
passphrase, it must be stored somewhere.  Your choices, in increasing
security, are:</p>
<ol class="arabic simple">
<li>encode the clear-text passphrase in each HTTPS URL in your repository configuration files</li>
<li>store the clear-text passphrase in your user configuration file</li>
<li>use the mercurial_keyring extension to store the passphrase cryptographically</li>
<p>Until recently, TortoiseHg only supported the first option in the
graphical interface even though the second and third options were
supported internally.  TortoiseHg 2.0, we only support the latter two
options in the graphical interface, and we do not allow the user
configure the first option anymore.  By default we strip the username
and password off of URLs when they are saved.</p>
<p>To migrate from the first option to the later options, select an HTTPS
URL in the sync tool, open the security dialog and enter a username and
passphrase for the host if none are configured, and save.  Next save the
URL itself and allow the save dialog to strip the user authentication
data from the URL.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If the mercurial_keyring extension is enabled, the security dialog
will not allow you to enter a passphrase since you do not want to
store the passphrase in clear text in your configuration file if you
are going to later store it cryptographically.</p>
<p>Options 2 and 3 use the [auth] section of your user configuration file
to configure a single username and passphrase (or certificate key files)
to authenticate to a given HTTPS hostname.  The [auth] section supports
many more configurations than this, see the man page for details.</p>
<p>Once the mercurial_keyring extension has been enabled (and all
applications are restarted), you can remove the HTTPS passphrases from
all of your configuration files.  Mercurial will prompt for the
passphrase once, then store it cryptographically using the best back-end
it can find for your platform.</p>
<p>The mercurial_keyring extension requires the [auth] section to be
configured for the host to which you are connecting, to provide the
username.  If your URL has an encoded username or passphrase, the
[auth] section is ignored.</p>
<div class="section" id="ssh">
<h3> SSH<a class="headerlink" href="#ssh" title="Permalink to this headline"></a></h3>
<p>SSH is a symmetrical peer-to-peer secure tunnel.  SSH clients and
servers have their own key management systems, so Mercurial does not get
involved with password prompts when SSH is used.  This is problematic on
Windows and thus TortoiseHg bundles the TortosePlink SSH client with its
Windows installers.  TortoisePlink is a port of the Plink SSH client
that uses dialog prompts for host-key authorizations and passphrase
prompts.  TortoisePlink (developed by the TortoiseSVN project) can use
the other SSH tools that are part of the Plink toolchain, including the
Pageant key agent.</p>
<p>It is a known issue that TortoisePlink does not use compression in many
scenarios, and thus is up to four times slower than openssh and other
clients.  TortoiseHg recommends the use of HTTPS for Windows clients.</p>
<p>See the <a class="reference internal" href="faq.html"><em>Frequently Asked Questions</em></a> for help if you have trouble connecting to ssh servers.</p>
<div class="section" id="email">
<h2>5.9.3. Email<a class="headerlink" href="#email" title="Permalink to this headline"></a></h2>
<div class="figure">
<img alt="Email dialog" src="_images/email1.png" />
<p class="caption">Email dialog</p>
<p>The email dialog can be launched from two TortoiseHg tools.</p>
<ol class="arabic simple">
<li>The Workbench, in which case the user intends to email a selection
of revisions.</li>
<li>The synchronize tool, in which case the user intends to email all
outgoing changes to the current target repository.</li>
<p>The <em class="guilabel">Send</em> button is obvious, and the <em class="guilabel">Configure</em>
dialog predictably opens the TortoiseHg Settings dialog to the email tab
where you can configure your SMTP settings and set default
<em class="guilabel">To:</em> and <em class="guilabel">From:</em> addresses.</p>
<p><em class="guilabel">In-Reply-To:</em> is used to make your patches properly threaded
in mailing lists.</p>
<p>Please consult the Mercurial documentation for the differences between
plain patches, Hg patches, Git patches, and bundles.</p>
<div class="section" id="from-command-line">
<h2>5.9.4. From command line<a class="headerlink" href="#from-command-line" title="Permalink to this headline"></a></h2>
<p>The synchronize tool can be started from command line</p>
<div class="highlight-python"><pre>thg sync

aliases: synchronize

Synchronize with other repositories

use "thg -v help sync" to show global options</pre>
<p>The syntax is simple, no options or parameters are needed, except the
global options.</p>

      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="index.html">
              <img class="logo" src="_static/thg_logo_92x50.png" alt="Logo"/>
  <h3><a href="index.html">Table Of Contents</a></h3>
<li><a class="reference internal" href="#">5.9. Synchronize</a><ul>
<li><a class="reference internal" href="#adding-an-url">5.9.1. Adding an URL</a></li>
<li><a class="reference internal" href="#security">5.9.2. Security</a><ul>
<li><a class="reference internal" href="#https"> HTTPS</a><ul>
<li><a class="reference internal" href="#host-authentication"> Host Authentication</a></li>
<li><a class="reference internal" href="#user-authentication"> User Authentication</a></li>
<li><a class="reference internal" href="#ssh"> SSH</a></li>
<li><a class="reference internal" href="#email">5.9.3. Email</a></li>
<li><a class="reference internal" href="#from-command-line">5.9.4. From command line</a></li>

  <h4>Previous topic</h4>
  <p class="topless"><a href="shelve.html"
                        title="previous chapter">5.8. Shelve</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="serve.html"
                        title="next chapter">5.10. Serve</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/sync.txt"
           rel="nofollow">Show Source</a></li>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
<script type="text/javascript">$('#searchbox').show(0);</script>
      <div class="clearer"></div>
    <div class="related">
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="serve.html" title="5.10. Serve"
             >next</a> |</li>
        <li class="right" >
          <a href="shelve.html" title="5.8. Shelve"
             >previous</a> |</li>
        <li><a href="index.html">TortoiseHg 2.4.0 documentation</a> &raquo;</li>
          <li><a href="daily.html" >5. TortoiseHg in daily use</a> &raquo;</li> 
    <div class="footer">
        &copy; Copyright 2012, Steve Borho and others.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.