1. Takayuki KONDO
  2. cointoss1973.bitbucket.org

Source

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



<!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>11. Debugging &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">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '2.4.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="top" title="TortoiseHg 2.4.0 documentation" href="index.html" />
    <link rel="prev" title="10. Frequently Asked Questions" href="faq.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="faq.html" title="10. Frequently Asked Questions"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">TortoiseHg 2.4.0 documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-debugging">
<span id="debugging"></span><h1>11. Debugging<a class="headerlink" href="#module-debugging" title="Permalink to this headline"></a></h1>
<div class="section" id="dialogs">
<h2>11.1. Dialogs<a class="headerlink" href="#dialogs" title="Permalink to this headline"></a></h2>
<p>Stderr is being captured to a buffer that is being inspected at program
exit.  If any serious errors (tracebacks, etc) are found in the stderr
buffer the entire contents are sent to the bug report tool so the user
can (should) report a bug.  If you suspect there are errors that are not
being reported, you can set the environment variable <strong>THGDEBUG</strong> to any
value to disable the stderr buffering.</p>
<p>If you have a bit of Python knowledge, you can also use:</p>
<div class="highlight-python"><pre>thg --debugger &lt;command&gt;</pre>
</div>
<p>To disable the forking behavior of thg, you can either set an
environment variable <strong>THG_HGTK_SPAWN</strong>, or add the command line
parameter &#8216;&#8211;nofork&#8217;.</p>
<div class="section" id="windows">
<h3>11.1.1. Windows<a class="headerlink" href="#windows" title="Permalink to this headline"></a></h3>
<p>To debug the changelog viewer, for instance, enter these commands
into a <strong class="command">cmd.exe</strong> window, while inside the repository:</p>
<div class="highlight-python"><pre>set THGDEBUG=1
thg --nofork log</pre>
</div>
</div>
<div class="section" id="linux-macosx">
<h3>11.1.2. Linux/MacOSX<a class="headerlink" href="#linux-macosx" title="Permalink to this headline"></a></h3>
<p>To debug the changelog viewer, for instance, enter these commands
into your shell window, while inside the repository:</p>
<div class="highlight-python"><pre>export THGDEBUG=1
thg --nofork log</pre>
</div>
</div>
</div>
<div class="section" id="shell-extension">
<h2>11.2. Shell Extension<a class="headerlink" href="#shell-extension" title="Permalink to this headline"></a></h2>
<p>The debugging mechanisms depend on your platform.</p>
<div class="section" id="id1">
<h3>11.2.1. Windows<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h3>
<p>See also <a class="reference external" href="http://msdn.microsoft.com/en-us/library/cc144064(VS.85).aspx">http://msdn.microsoft.com/en-us/library/cc144064(VS.85).aspx</a>
for some info bits about Running and Testing Shell Extensions on Windows</p>
<p>The <strong class="command">DbgView</strong> tool from the SysInternals suite will capture
debug messages from the shell extension.  However, the shell
extension does not emit debugging info by default.  It must be enabled
by setting the registry key defined in
<tt class="file docutils literal"><span class="pre">win32/shellext/DebugShellExt.reg</span></tt> in the TortoiseHg source
repository.  You can double-click on this file to load the key into your
registry.</p>
<p>Another option is to exit the <strong class="command">TortoiseHgOverlayServer</strong> system tray
application and start it from the command line.  It will emit some debug
information to the console.</p>
</div>
<div class="section" id="nautilus">
<h3>11.2.2. Nautilus<a class="headerlink" href="#nautilus" title="Permalink to this headline"></a></h3>
<p>Debugging is done via the environment variable DEBUG_THG</p>
<ul>
<li><p class="first">to test in a separate process:</p>
<div class="highlight-python"><pre>DEBUG_THG=Ne TMPDIR=/tmp/anydir/ --no-desktop nautilus [path]</pre>
</div>
</li>
<li><p class="first">to test in the main instance:</p>
<div class="highlight-python"><pre>nautilus -q
DEBUG_THG=NOe nautilus</pre>
</div>
</li>
<li><p class="first">permanent debugging, set DEBUG_THG in a file which is read on session
start (~/.profile, ~/.xprofile)</p>
</li>
</ul>
<p>Upper case characters in DEBUG_THG specify modules.  Only <em>O</em> and <em>N</em>
for <em>OverlayCache</em> and <em>Nautilus</em>, respectively, are supported module
names.  Lower case characters imply parts. Only <em>e</em> is supported,
implying <em>error</em> messages.</p>
<p>To restart nautilus, chose either</p>
<ol class="arabic simple">
<li>killall nautilus (the session restarts nautilus automatically, stdin and stdout go to ~/.xsession-errors)</li>
<li>nautilus -q; nautilus (stdin and stdout are on the console)</li>
</ol>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <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="#">11. Debugging</a><ul>
<li><a class="reference internal" href="#dialogs">11.1. Dialogs</a><ul>
<li><a class="reference internal" href="#windows">11.1.1. Windows</a></li>
<li><a class="reference internal" href="#linux-macosx">11.1.2. Linux/MacOSX</a></li>
</ul>
</li>
<li><a class="reference internal" href="#shell-extension">11.2. Shell Extension</a><ul>
<li><a class="reference internal" href="#id1">11.2.1. Windows</a></li>
<li><a class="reference internal" href="#nautilus">11.2.2. Nautilus</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="faq.html"
                        title="previous chapter">10. Frequently Asked Questions</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/debugging.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<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" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="faq.html" title="10. Frequently Asked Questions"
             >previous</a> |</li>
        <li><a href="index.html">TortoiseHg 2.4.0 documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2012, Steve Borho and others.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
  </body>
</html>