Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > 67810d03ada515381702f7b70888f800 > files > 496

tortoisehg-4.9.1-1.mga7.noarch.rpm


<!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="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>5.7. Commit &#8212; 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" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></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>
    <script type="text/javascript" src="_static/language_data.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="5.8. Shelve" href="shelve.html" />
    <link rel="prev" title="5.6. Clone a repository" href="clone.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>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  <div class="section" id="module-commit.dialog">
<span id="commit"></span><h1>5.7. Commit<a class="headerlink" href="#module-commit.dialog" title="Permalink to this headline">¶</a></h1>
<p>The commit tool is second most commonly used application after the
Workbench.  Not only can the commit tool commit your changes, but it can
also examine the state of your working directory and perform most
routine maintenance tasks (add new files, detect renames, manage the
ignore filter, etc).</p>
<div class="figure" id="id1">
<img alt="Commit dialog" src="_images/commit.png" />
<p class="caption"><span class="caption-text">Commit dialog</span></p>
</div>
<div class="section" id="features">
<h2>5.7.1. Features<a class="headerlink" href="#features" title="Permalink to this headline">¶</a></h2>
<p>Enumerating the toolbar buttons:</p>
<blockquote>
<div><dl class="docutils">
<dt><span class="guilabel">Branch dialog</span></dt>
<dd>Shows the current branch name of the working directory. Normally
this is informational only, but pressing this button opens up a
branch maintenance dialog.  Do not use this feature unless you
understand Mercurial’s
<a class="reference external" href="https://www.mercurial-scm.org/wiki/NamedBranches">named branches</a>.</dd>
<dt><span class="guilabel">Recent Commit Messages</span></dt>
<dd>A drop-down list of the 10 most recent commit messages. The
the drop-down list is filled the first time it is opened.</dd>
<dt><span class="guilabel">Commit</span></dt>
<dd>Commit selected diffs in checked files.</dd>
<dt><span class="guilabel">Undo</span></dt>
<dd>Undo (rollback) last immediate commit. Your commit message will be
available in the message history, so you can easily repeat the
commit if necessary.</dd>
</dl>
</div></blockquote>
<p>The file list has four columns:</p>
<blockquote>
<div><ol class="arabic simple">
<li>A checkbox that indicates whether the file is selected for an
operation.  The toolbar buttons only operate on checked files.
“Partially” selected files have a special check state.  This
column header is checkable, it will toggle the file selection
states.</li>
<li>The <span class="guilabel">st</span> column holds the status of the file, defined
by Mercurial’s status command, one of ‘MARD?IC’.  A status of ‘S’
indicates a dirty subrepository that needs to be committed.</li>
<li>The <span class="guilabel">ms</span> column holds the merge state of the file,
defined by Mercurial’s resolve command, one of ‘ RU’.  See the
merge section below.</li>
<li>The canonical path of the file relative to the repository root</li>
</ol>
</div></blockquote>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If the commit tool was started with a file pattern or selection, a
button will appear at the bottom of the file list that can clear the
file pattern and give you an unfiltered view of the entire working
directory.</p>
</div>
<p>The <span class="guilabel">Status</span> button has a menu with checkable options that
toggle the display of the various classes of files {modified, added,
removed, deleted, unknown, clean, ignored}.</p>
<p><em>Removed</em> means a revisioned file has been marked as removed. <em>Deleted</em>
means a revisioned file is missing but Mercurial has not been told to
quit tracking that file. For instance, if you rename a revisioned file
in Explorer, the original filename will show up as deleted and the
new filename will show up as unknown. By right-clicking on the new
filename you can bring up the rename guessing dialog which can discover
the rename by comparing file contents and mark the old file as removed
and the new file as added while recording the whole operation as a
rename.</p>
<p><em>Unknown</em> files are not tracked by Mercurial, but they also do not match
any ignore filters you have configured.  Unknown files are shown by
default because they are usually files that need to be added to revision
control.  It is recommended that you keep your ignore filters up to date
to ensure that is the case.  The context menu of unknown files has an
option open the ignore pattern tool.</p>
<p><em>Clean</em> files are tracked files that have not been modified, while
<em>Ignored</em> files are untracked files that match a configured ignore
pattern.  Neither of those file types are shown by default, unless a the
user includes such a file in a selection (explorer) or provides the file
name on the command line.</p>
</div>
<div class="section" id="change-selection">
<h2>5.7.2. Change Selection<a class="headerlink" href="#change-selection" title="Permalink to this headline">¶</a></h2>
<p>Change selection is the process of selecting which of the changes you
have made to the working directory will be included in the next commit.
The commit tool allows one to exclude modified (or added or removed)
files from a commit, leaving them with their same state after the
commit.</p>
<p>This somewhat violates Mercurial’s precept that each changeset
describes the state of the repository at a single point in time.  When
you exclude files from the commit, the changeset you create may never
have existed.  But since file selection during commit is sometimes
convenient, and is supported by Mercurial itself, our commit tool has
supported this feature from its first release.</p>
<p>New in TortoiseHg 2.7, the commit tool now allows one to partially
select modified files.  This means you can now exclude a portion of the
changes you have made to the file.  This further violates Mercurial’s
precept of committing the state of the working copy, but it is a very
useful feature.  The most commonly cited example is being able to check
in a bug fix while excluding all your debug instrumentation so that you
can continue debugging after the commit.</p>
<p>When the user has excluded one or more of the changes made to a file,
TortoiseHg considers the file partially selected (and this change
selection feature is sometimes referred to as <strong>partial commit</strong>).
Partially selected files are displayed in the file list with a special
partial check state.</p>
<p>The diff view pane has a context menu option for configuring the
marking of excluded changes.  <span class="menuselection">Mark excluded changes</span>
toggles a strike-through indicator on excluded changes.  This setting is
primarily a personal preference, but future versions of TortoiseHg may
extend the use of the strike-through indicator for partial exclusion of
individual changes.</p>
<p>This new partial selection feature is similar to hgtk’s
<a class="reference external" href="https://tortoisehg.bitbucket.io/manual/0.9/commit.html#change-selection">chunk selection</a>,
but is superior in several ways:</p>
<ol class="arabic simple">
<li>Change selection is integrated directly into the diff view. No mode
switch is required.</li>
<li>The working copy files are not modified during partial commit. This
avoids serious file permission problems on Windows.</li>
<li>Change selection is possible for copied or renamed files, with one
exception. You cannot exclude all of the changes because this
excludes the entire file from the commit.</li>
</ol>
<p>TortoiseHg has had a shelve tool since version 2.0 which can move
selected changes from the working directory to a patch (or between
patches) but the partial commit feature is very different in that it
never modifies the working copy files.  All it is doing is excluding a
portion of your changes from the version of the file which is committed
to the repository.  After the commit, all of your excluded changes will
still remain in the working copy.</p>
<p>When the commit button is pressed, the commit tool checks if any of the
checked files are partially excluded.  If any such partial commits are
required, the commit tool builds a temporary patch file which describes
how to generate the contents of the partially excluded files and passes
that patch file to TortoiseHg’s partial commit extension.  This
extension triggers Mercurial’s commit command with special hooks so that
the partial commit file contents come from patched tempfiles instead of
being read from the working copy.  After the commit the temporary files
and patch are deleted but the working copy files are completely
untouched.</p>
</div>
<div class="section" id="keyboard-navigation">
<h2>5.7.3. Keyboard navigation<a class="headerlink" href="#keyboard-navigation" title="Permalink to this headline">¶</a></h2>
<dl class="docutils">
<dt><kbd class="kbd docutils literal notranslate">Ctrl-Enter</kbd></dt>
<dd>Trigger the commit</dd>
<dt><kbd class="kbd docutils literal notranslate">Ctrl-E</kbd></dt>
<dd>Reflow the paragraph currently under the cursor.  You must configure
a message format policy for this shortcut to work.</dd>
</dl>
</div>
<div class="section" id="file-context-menus">
<h2>5.7.4. File Context Menus<a class="headerlink" href="#file-context-menus" title="Permalink to this headline">¶</a></h2>
<p>When right clicking on files in the file list, you will get a context
menu of commands that are applicable to the selected files.</p>
<p>For unknown <strong>?</strong> files, the context menu will allow you to detect
renames (if you think the unknown file is a copy or rename of a
revisioned file) or to configure the repository’s ignore filter (if the
unknown file should never be revisioned and you want Mercurial to ignore
it).</p>
</div>
<div class="section" id="merging">
<h2>5.7.5. Merging<a class="headerlink" href="#merging" title="Permalink to this headline">¶</a></h2>
<p>The commit tool has a special mode when it is opened in a repository
that is in a merged state (either a merge is in progress, or an update
was performed that caused a conflict).</p>
<p>The merge state <em>ms</em> column is especially useful in this mode.  Files
that are marked with <em>R</em> are files where Mercurial and/or the user have
successfully merged (resolved) changes from both parents. Files that
are marked with <em>U</em> have unresolved changes. You can use the <em>Restart
Merge</em> context menu option to restart the merge for those files, or you
can use the <em>edit</em> context menu option to resolve the conflict by hand.
The <em>Restart Merge</em> menu option allows you to select the merge tool to
use to perform the merge, or even to pick one version or the other
unconditionally (internal:local, internal:other).  After the conflicts
have been manually resolved, you must use the <em>mark resolved</em> context
menu option to change the file’s merge state to <em>R</em>.</p>
<p>Mercurial will not allow you to commit a merge if any files have
unresolved <em>U</em> merge states.</p>
<p>For your reference, <em>local</em> is the revision you had checked out when you
started the merge and <em>other</em> is the revision you merged with.</p>
<p>To undo a failed merge attempt, you must tell Mercurial to remove the
second parent from your working directory.  This usually means
performing a clean update of the first parent.  The merge tool has an
<span class="guilabel">Undo</span> button which does exactly that.</p>
<p>Once you have your working directory back at one parent revision, you
may restart the merge process.</p>
</div>
<div class="section" id="commit-message-pane">
<h2>5.7.6. Commit Message Pane<a class="headerlink" href="#commit-message-pane" title="Permalink to this headline">¶</a></h2>
<p>The commit message pane has these special context menu options:</p>
<blockquote>
<div><dl class="docutils">
<dt><span class="guilabel">Paste Filenames</span>:</dt>
<dd>Paste checked filenames into the commit message at the cursor.</dd>
<dt><span class="guilabel">Apply Format</span>:</dt>
<dd>Apply configured message wrap policy to current message.</dd>
<dt><span class="guilabel">Configure Format</span>:</dt>
<dd>Opens the settings dialog to the <span class="guilabel">Commit</span> tab.</dd>
</dl>
</div></blockquote>
<p>If your project has guidelines for the format of commit messages, you
can configure them in the settings tool.  The commit tool will enforce
your policy at commit time, and you can ask the tool to apply the format
to the current message.  The <span class="guilabel">Commit</span> tab of the settings tool
has these two configurables for commit message policy:</p>
<blockquote>
<div><dl class="docutils">
<dt><span class="guilabel">Summary Line Length</span>:</dt>
<dd>Maximum length of the commit message summary line.  If set,
TortoiseHg will draw a line at the specified width.</dd>
</dl>
</div></blockquote>
</div>
<div class="section" id="subrepositories">
<h2>5.7.7. Subrepositories<a class="headerlink" href="#subrepositories" title="Permalink to this headline">¶</a></h2>
<p>A <a class="reference external" href="https://www.mercurial-scm.org/wiki/Subrepository">subrepository</a>
is a feature introduced in Mercurial 1.3.  It allows one Mercurial
repository to store references to external Mercurial (or potentially
other VCS) repositories, and to include the state of those external
repositories in the main repository’s history.</p>
<p>TortoiseHg 1.0 introduced rudimentary support for subrepositories, and
only in the commit / status tool.  When Mercurial considers a subrepo
dirty, it will appear in the commit tool as a special entry in the file
list with a status of <em>S</em>.  If a subrepo is included in the file list of
a commit, the subrepo is committed along with the other changes,
updating the .hgsubstate file in the main repository root.</p>
</div>
<div class="section" id="configurables">
<h2>5.7.8. Configurables<a class="headerlink" href="#configurables" title="Permalink to this headline">¶</a></h2>
<dl class="docutils">
<dt><span class="menuselection">Commit ‣ Username</span></dt>
<dd>Sets username associated with your commits (see <a class="reference internal" href="quick.html"><span class="doc">A Quick Start Guide to TortoiseHg</span></a>)</dd>
<dt><span class="menuselection">Commit ‣ Summary Line Length</span></dt>
<dd>Configures a ‘policy’ limit for summary lines</dd>
<dt><span class="menuselection">Commit ‣ Close After Commit</span>:</dt>
<dd>When set to True, the commit tool will close after a
successful commit.</dd>
</dl>
<p>And three other features for <em>advanced</em> users.</p>
<dl class="docutils">
<dt><span class="menuselection">Commit ‣ Push After Commit</span>:</dt>
<dd>If configured, the commit tool will try to push to the configured
URL or alias after each commit.</dd>
<dt><span class="menuselection">Commit ‣ Auto Commit List</span>:</dt>
<dd>Comma separated list of files that are automatically included in
every commit.  Intended for use only as a repository setting.</dd>
<dt><span class="menuselection">TortoiseHg ‣ Max Diff Size</span></dt>
<dd>Configures the diff size limit</dd>
</dl>
</div>
<div class="section" id="from-command-line">
<h2>5.7.9. From command line<a class="headerlink" href="#from-command-line" title="Permalink to this headline">¶</a></h2>
<p>The commit tool can be started from command line:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">thg</span> <span class="n">commit</span> <span class="p">[</span><span class="n">OPTIONS</span><span class="p">]</span> <span class="p">[</span><span class="n">FILE</span><span class="p">]</span><span class="o">...</span>

<span class="n">aliases</span><span class="p">:</span> <span class="n">ci</span>

<span class="n">commit</span> <span class="n">tool</span>

<span class="n">options</span><span class="p">:</span>

 <span class="o">-</span><span class="n">u</span> <span class="o">--</span><span class="n">user</span>  <span class="n">record</span> <span class="n">user</span> <span class="k">as</span> <span class="n">committer</span>
 <span class="o">-</span><span class="n">d</span> <span class="o">--</span><span class="n">date</span>  <span class="n">record</span> <span class="n">datecode</span> <span class="k">as</span> <span class="n">commit</span> <span class="n">date</span>

<span class="n">use</span> <span class="s2">&quot;thg -v help commit&quot;</span> <span class="n">to</span> <span class="n">show</span> <span class="k">global</span> <span class="n">options</span>
</pre></div>
</div>
<p>For a quick help on the format of date type:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">hg</span> <span class="n">help</span> <span class="n">dates</span>
</pre></div>
</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>
<h1 class="logo"><a href="index.html">TortoiseHg</a></h1>








<h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="preface.html">1. Preface</a></li>
<li class="toctree-l1"><a class="reference internal" href="intro.html">2. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="whatsnew.html">3. What’s New</a></li>
<li class="toctree-l1"><a class="reference internal" href="quick.html">4. A Quick Start Guide to TortoiseHg</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="daily.html">5. TortoiseHg in daily use</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="common.html">5.1. Common Features</a></li>
<li class="toctree-l2"><a class="reference internal" href="explorer.html">5.2. Windows Explorer Integration</a></li>
<li class="toctree-l2"><a class="reference internal" href="nautilus.html">5.3. GNOME desktop integration</a></li>
<li class="toctree-l2"><a class="reference internal" href="workbench.html">5.4. Workbench</a></li>
<li class="toctree-l2"><a class="reference internal" href="init.html">5.5. Create a new repository</a></li>
<li class="toctree-l2"><a class="reference internal" href="clone.html">5.6. Clone a repository</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">5.7. Commit</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#features">5.7.1. Features</a></li>
<li class="toctree-l3"><a class="reference internal" href="#change-selection">5.7.2. Change Selection</a></li>
<li class="toctree-l3"><a class="reference internal" href="#keyboard-navigation">5.7.3. Keyboard navigation</a></li>
<li class="toctree-l3"><a class="reference internal" href="#file-context-menus">5.7.4. File Context Menus</a></li>
<li class="toctree-l3"><a class="reference internal" href="#merging">5.7.5. Merging</a></li>
<li class="toctree-l3"><a class="reference internal" href="#commit-message-pane">5.7.6. Commit Message Pane</a></li>
<li class="toctree-l3"><a class="reference internal" href="#subrepositories">5.7.7. Subrepositories</a></li>
<li class="toctree-l3"><a class="reference internal" href="#configurables">5.7.8. Configurables</a></li>
<li class="toctree-l3"><a class="reference internal" href="#from-command-line">5.7.9. From command line</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="shelve.html">5.8. Shelve</a></li>
<li class="toctree-l2"><a class="reference internal" href="sync.html">5.9. Synchronize</a></li>
<li class="toctree-l2"><a class="reference internal" href="serve.html">5.10. Serve</a></li>
<li class="toctree-l2"><a class="reference internal" href="guess.html">5.11. Detect Renames</a></li>
<li class="toctree-l2"><a class="reference internal" href="ignore.html">5.12. Ignore Filter</a></li>
<li class="toctree-l2"><a class="reference internal" href="archive.html">5.13. Archiving</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="settings.html">6. Settings</a></li>
<li class="toctree-l1"><a class="reference internal" href="patches.html">7. Patches</a></li>
<li class="toctree-l1"><a class="reference internal" href="extensions.html">8. Extensions</a></li>
<li class="toctree-l1"><a class="reference internal" href="nonhg.html">9. Use with other VCS systems</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">10. Frequently Asked Questions</a></li>
<li class="toctree-l1"><a class="reference internal" href="debugging.html">11. Debugging</a></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="clone.html" title="previous chapter">5.6. Clone a repository</a></li>
      <li>Next: <a href="shelve.html" title="next chapter">5.8. Shelve</a></li>
  </ul></li>
  </ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <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" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>








        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      &copy;2010-2019, Steve Borho and others.
      
      |
      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.8.4</a>
      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
      
      |
      <a href="_sources/commit.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>