Sophie

Sophie

distrib > Fedora > 16 > x86_64 > by-pkgid > a99c463cccd19ab912401d5eb4e6ee20 > files > 385

bzr-doc-2.4.2-1.fc16.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="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Web-based code browsing &mdash; Bazaar v2.4.2 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.2',
        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="shortcut icon" href="../_static/bzr.ico"/>
    <link rel="top" title="Bazaar v2.4.2 documentation" href="../index.html" />
    <link rel="up" title="Bazaar System Administrator’s Guide" href="index.html" />
    <link rel="next" title="Integration with Other Tools" href="integration.html" />
    <link rel="prev" title="Extending Bazaar with Hooks and Plugins" href="hooks-plugins.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="integration.html" title="Integration with Other Tools"
             accesskey="N">next</a></li>
        <li class="right" >
          <a href="hooks-plugins.html" title="Extending Bazaar with Hooks and Plugins"
             accesskey="P">previous</a> |</li>
<li><a href="http://bazaar.canonical.com/">
    <img src="../_static/bzr icon 16.png" /> Home</a>&nbsp;|&nbsp;</li>
<a href="http://doc.bazaar.canonical.com/en/">Documentation</a>&nbsp;|&nbsp;</li>

        <li><a href="../index.html">Table of Contents (2.4.2)</a> &raquo;</li>

          <li><a href="index.html" accesskey="U">Bazaar System Administrator&#8217;s Guide</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="web-based-code-browsing">
<h1>Web-based code browsing<a class="headerlink" href="#web-based-code-browsing" title="Permalink to this headline">¶</a></h1>
<p>Browsing the history of a project online is an important part of version
control, since it allows people to easily see what happens in a branch
without having to have a local, up-to-date copy of that branch.  There are a
number of possible choices for browsing Bazaar branches on the web, but we
will cover one of them in particular detail and briefly mention the other
choices where they differ.</p>
<div class="section" id="loggerhead">
<h2>Loggerhead<a class="headerlink" href="#loggerhead" title="Permalink to this headline">¶</a></h2>
<p><a class="reference external" href="http://launchpad.net/loggerhead">Loggerhead</a> is a code browsing interface for Bazaar branches (now used in
Launchpad).  To see an example of Loggerhead in action, browse to
<a class="reference external" href="http://bazaar.launchpad.net/~bzr-pqm/bzr/bzr.dev/files">http://bazaar.launchpad.net/~bzr-pqm/bzr/bzr.dev/files</a> which is the loggerhead
view of Bazaar&#8217;s trunk branch.  Loggerhead runs as a web application on the
server which is accessed over HTTP via a RESTful interface.  It is possible to
run this application on its own dedicated port as
<tt class="docutils literal"><span class="pre">http://www.example.com:8080</span></tt> or to proxy this location behind a separate web
server, for example at <tt class="docutils literal"><span class="pre">http://www.example.com/loggerhead/</span></tt>.  We will discuss
both of these configurations below.</p>
<div class="section" id="requirements">
<h3>Requirements<a class="headerlink" href="#requirements" title="Permalink to this headline">¶</a></h3>
<p>Loggerhead depends on a number of other Python packages for the various Web
technologies that it builds on.  Some of these must be installed to use
loggerhead, although some of them are optional.  From the loggerhead <cite>README</cite>
file, these are</p>
<ol class="arabic simple">
<li>SimpleTAL for templating.
On Ubuntu, <cite>sudo apt-get install python-simpletal</cite>
or download from <a class="reference external" href="http://www.owlfish.com/software/simpleTAL/download.html">http://www.owlfish.com/software/simpleTAL/download.html</a></li>
<li>simplejson for producing JSON data.
On Ubuntu, <cite>sudo apt-get install python-simplejson</cite>
or use <cite>easy_install simplejson</cite>.</li>
<li>Paste for the server. (You need version 1.2 or newer of Paste.)
On Ubuntu, <cite>sudo apt-get install python-paste</cite>
or use <cite>easy_install Paste</cite></li>
<li>Paste Deploy  (optional, needed when proxying through Apache)
On Ubuntu, <cite>sudo apt-get install python-pastedeploy</cite>
or use <cite>easy_install PasteDeploy</cite></li>
<li>flup (optional, needed to use FastCGI, SCGI or AJP)
On Ubuntu, <cite>sudo apt-get install python-flup</cite>
or use <cite>easy_install flup</cite></li>
</ol>
<p>Although directions for installing these on Ubuntu are given, most other
GNU/Linux distributions should package these dependencies, making installation
easy.  For Windows and Mac OS X, they should all be <tt class="docutils literal"><span class="pre">easy_install</span></tt>-able or at
worst installable from the Python sources.</p>
</div>
<div class="section" id="built-in-web-server">
<h3>Built-in Web Server<a class="headerlink" href="#built-in-web-server" title="Permalink to this headline">¶</a></h3>
<p>Loggerhead has a built-in web server and when started with the
<tt class="docutils literal"><span class="pre">serve-branches</span></tt> command, that web server is started on a default port
listening on the localhost.  If port 8080 (the default) is accessible on
<tt class="docutils literal"><span class="pre">www.example.com</span></tt>, then running</p>
<div class="highlight-python"><pre>$ serve-branches --host=www.example.com --port=8080 /srv/bzr</pre>
</div>
<p>will list all of the available branches under that directory on
<tt class="docutils literal"><span class="pre">http://www.example.com:8080/</span></tt>, so that the ProjectX trunk could be browsed
at <tt class="docutils literal"><span class="pre">http://www.example.com:8080/projectx/trunk</span></tt>.  Note that loggerhead
provides HTTP access to the underlying Bazaar branches (similar to that
described in <a class="reference external" href="other-setups.html#smart-server-over-http-s">Smart server over HTTP(S)</a>), so this command should be run
as a user without write privileges in <tt class="docutils literal"><span class="pre">/srv/bzr</span></tt>.  By default, loggerhead
only listens on the localhost, not any external ports, unless specified as
above.</p>
</div>
<div class="section" id="behind-a-proxy">
<h3>Behind a Proxy<a class="headerlink" href="#behind-a-proxy" title="Permalink to this headline">¶</a></h3>
<p>A more common and more safe way to run loggerhead is behind another web server
which will proxy certain requests to the loggerhead server on the localhost.
To do this, you need to have PasteDeploy installed (see <a class="reference internal" href="#requirements">Requirements</a>).
Assuming that your server has Apache running, you need to add configuration
such as this to set up the proxy</p>
<div class="highlight-python"><pre>&lt;Location "/loggerhead/"&gt;
    ProxyPass http://127.0.0.1:8080/
    ProxyPassReverse http://127.0.0.1:8080/
&lt;/Location&gt;</pre>
</div>
<p>If your proxy runs at some path within the server, then the <tt class="docutils literal"><span class="pre">serve-branches</span></tt>
command must be started with the <tt class="docutils literal"><span class="pre">--prefix</span></tt> option.  For this example, we
could start loggerhead with the command</p>
<div class="highlight-python"><pre>$ serve-branches --prefix=/loggerhead /srv/bzr</pre>
</div>
<p>This would allow the trunk branch of ProjectX to be browsed at
<tt class="docutils literal"><span class="pre">http://www.example.com/loggerhead/projectx/trunk</span></tt>.</p>
<p>Loggerhead comes with a script allowing it to run as a service on
<tt class="docutils literal"><span class="pre">init.d</span></tt> based Unix systems.  Contributions to do a similar thing on
Windows servers would be welcomed at <a class="reference external" href="http://launchpad.net/loggerhead">http://launchpad.net/loggerhead</a>.</p>
</div>
</div>
<div class="section" id="other-web-interfaces">
<h2>Other web interfaces<a class="headerlink" href="#other-web-interfaces" title="Permalink to this headline">¶</a></h2>
<p>There are a number of other web interfaces available for Bazaar branches (see
the list at <a class="reference external" href="http://wiki.bazaar.canonical.com/WebInterfaces">http://wiki.bazaar.canonical.com/WebInterfaces</a>) and we will just
mention a couple of them here for their advantages in particular situations.</p>
<dl class="docutils">
<dt>trac+bzr (<a class="reference external" href="http://launchpad.net/trac-bzr">http://launchpad.net/trac-bzr</a>)</dt>
<dd>Trac is a popular web app that integrates a browser for branches, an issue
tracker and a wiki.  trac+bzr is a trac extension that allows for the
trac to be used with Bazaar.</dd>
<dt>webbzr (<a class="reference external" href="http://thoughts.enseed.com/webbzr">http://thoughts.enseed.com/webbzr</a>)</dt>
<dd>This is a notable solution because it is written in pure PHP for web hosts
that don&#8217;t provide a way to run arbitrary Python applications such as Trac
or Loggerhead.</dd>
<dt>Redmine (<a class="reference external" href="http://redmine.org/">http://redmine.org/</a>)</dt>
<dd>Like trac, Redmine is a full project management application using the Ruby
on Rails framework.  It includes support for Bazaar branches.</dd>
</dl>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Web-based code browsing</a><ul>
<li><a class="reference internal" href="#loggerhead">Loggerhead</a><ul>
<li><a class="reference internal" href="#requirements">Requirements</a></li>
<li><a class="reference internal" href="#built-in-web-server">Built-in Web Server</a></li>
<li><a class="reference internal" href="#behind-a-proxy">Behind a Proxy</a></li>
</ul>
</li>
<li><a class="reference internal" href="#other-web-interfaces">Other web interfaces</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="hooks-plugins.html"
                        title="previous chapter">Extending Bazaar with Hooks and Plugins</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="integration.html"
                        title="next chapter">Integration with Other Tools</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/admin-guide/code-browsing.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" size="18" />
      <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="integration.html" title="Integration with Other Tools"
             >next</a></li>
        <li class="right" >
          <a href="hooks-plugins.html" title="Extending Bazaar with Hooks and Plugins"
             >previous</a> |</li>
<li><a href="http://bazaar.canonical.com/">
    <img src="../_static/bzr icon 16.png" /> Home</a>&nbsp;|&nbsp;</li>
<a href="http://doc.bazaar.canonical.com/en/">Documentation</a>&nbsp;|&nbsp;</li>

        <li><a href="../index.html">Table of Contents (2.4.2)</a> &raquo;</li>

          <li><a href="index.html" >Bazaar System Administrator&#8217;s Guide</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2009-2011 Canonical Ltd.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
    </div>
  </body>
</html>