/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to doc/en/admin-guide/code-browsing.txt

  • Committer: Martin Pool
  • Date: 2005-06-28 03:02:31 UTC
  • Revision ID: mbp@sourcefrog.net-20050628030231-d311e4ebcd467ef4
Merge John's import-speedup branch:

                                                                                         
  777 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 22:20:32 -0500
      revision-id: john@arbash-meinel.com-20050627032031-e82a50db3863b18e
      bzr selftest was not using the correct bzr

  776 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 22:20:22 -0500
      revision-id: john@arbash-meinel.com-20050627032021-c9f21fde989ddaee
      Add was using an old mutter

  775 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 22:02:33 -0500
      revision-id: john@arbash-meinel.com-20050627030233-9165cfe98fc63298
      Cleaned up to be less different

  774 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 21:54:53 -0500
      revision-id: john@arbash-meinel.com-20050627025452-4260d0e744edef43
      Allow BZR_PLUGIN_PATH='' to negate plugin loading.

  773 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 21:49:34 -0500
      revision-id: john@arbash-meinel.com-20050627024933-b7158f67b7b9eae5
      Finished the previous cleanup (allowing load_plugins to be called twice)

  772 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 21:45:08 -0500
      revision-id: john@arbash-meinel.com-20050627024508-723b1df510d196fc
      Work on making the tests pass. versioning.py is calling run_cmd directly, but plugins have been loaded.

  771 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 21:32:29 -0500
      revision-id: john@arbash-meinel.com-20050627023228-79972744d7c53e15
      Got it down a little bit more by removing import of tree and inventory.

  770 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 21:26:05 -0500
      revision-id: john@arbash-meinel.com-20050627022604-350b9773ef622f95
      Reducing the number of import from bzrlib/__init__.py and bzrlib/branch.py

  769 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 20:32:25 -0500
      revision-id: john@arbash-meinel.com-20050627013225-32dd044f10d23948
      Updated revision.py and xml.py to include SubElement.

  768 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 20:03:56 -0500
      revision-id: john@arbash-meinel.com-20050627010356-ee66919e1c377faf
      Minor typo

  767 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 20:03:13 -0500
      revision-id: john@arbash-meinel.com-20050627010312-40d024007eb85051
      Caching the import

  766 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 19:51:47 -0500
      revision-id: john@arbash-meinel.com-20050627005147-5281c99e48ed1834
      Created wrapper functions for lazy import of ElementTree

  765 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 19:46:37 -0500
      revision-id: john@arbash-meinel.com-20050627004636-bf432902004a94c5
      Removed all of the test imports of cElementTree

  764 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 19:43:59 -0500
      revision-id: john@arbash-meinel.com-20050627004358-d137fbe9570dd71b
      Trying to make bzr startup faster.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Web-based code browsing
2
 
=======================
3
 
 
4
 
Browsing the history of a project online is an important part of version
5
 
control, since it allows people to easily see what happens in a branch
6
 
without having to have a local, up-to-date copy of that branch.  There are a
7
 
number of possible choices for browsing Bazaar branches on the web, but we
8
 
will cover one of them in particular detail and briefly mention the other
9
 
choices where they differ.
10
 
 
11
 
Loggerhead
12
 
----------
13
 
 
14
 
Loggerhead_ is a code browsing interface for Bazaar branches (now used in
15
 
Launchpad).  To see an example of Loggerhead in action, browse to
16
 
http://bazaar.launchpad.net/~bzr-pqm/bzr/bzr.dev/files which is the loggerhead
17
 
view of Bazaar's trunk branch.  Loggerhead runs as a web application on the
18
 
server which is accessed over HTTP via a RESTful interface.  It is possible to
19
 
run this application on its own dedicated port as
20
 
``http://www.example.com:8080`` or to proxy this location behind a separate web
21
 
server, for example at ``http://www.example.com/loggerhead/``.  We will discuss
22
 
both of these configurations below.
23
 
 
24
 
.. _Loggerhead: http://launchpad.net/loggerhead
25
 
 
26
 
Requirements
27
 
~~~~~~~~~~~~
28
 
 
29
 
Loggerhead depends on a number of other Python packages for the various Web
30
 
technologies that it builds on.  Some of these must be installed to use
31
 
loggerhead, although some of them are optional.  From the loggerhead `README`
32
 
file, these are
33
 
 
34
 
1) SimpleTAL for templating.
35
 
   On Ubuntu, `sudo apt-get install python-simpletal`
36
 
   or download from http://www.owlfish.com/software/simpleTAL/download.html
37
 
2) simplejson for producing JSON data.
38
 
   On Ubuntu, `sudo apt-get install python-simplejson`
39
 
   or use `easy_install simplejson`.
40
 
3) Paste for the server. (You need version 1.2 or newer of Paste.)
41
 
   On Ubuntu, `sudo apt-get install python-paste`
42
 
   or use `easy_install Paste`
43
 
4) Paste Deploy  (optional, needed when proxying through Apache)
44
 
   On Ubuntu, `sudo apt-get install python-pastedeploy`
45
 
   or use `easy_install PasteDeploy`
46
 
5) flup (optional, needed to use FastCGI, SCGI or AJP)
47
 
   On Ubuntu, `sudo apt-get install python-flup`
48
 
   or use `easy_install flup`
49
 
 
50
 
Although directions for installing these on Ubuntu Linux are given, most other
51
 
Linux distributions should package these dependencies, making installation
52
 
easy.  For Windows and Mac OS X, they should all be ``easy_install``-able or at
53
 
worst installable from the Python sources.
54
 
 
55
 
Built-in Web Server
56
 
~~~~~~~~~~~~~~~~~~~
57
 
 
58
 
Loggerhead has a built-in web server and when started with the
59
 
``serve-branches`` command, that web server is started on a default port
60
 
listening on the localhost.  If port 8080 (the default) is accessible on
61
 
``www.example.com``, then running
62
 
 
63
 
::
64
 
 
65
 
  $ serve-branches --host=www.example.com --port=8080 /srv/bzr
66
 
 
67
 
will list all of the available branches under that directory on
68
 
``http://www.example.com:8080/``, so that the ProjectX trunk could be browsed
69
 
at ``http://www.example.com:8080/projectx/trunk``.  Note that loggerhead
70
 
provides HTTP access to the underlying Bazaar branches (similar to that
71
 
described in `Smart server over HTTP(S)
72
 
<other-setups.html#smart-server-over-http-s>`_), so this command should be run
73
 
as a user without write privileges in ``/srv/bzr``.  By default, loggerhead
74
 
only listens on the localhost, not any external ports, unless specified as
75
 
above.
76
 
 
77
 
Behind a Proxy
78
 
~~~~~~~~~~~~~~
79
 
 
80
 
A more common and more safe way to run loggerhead is behind another web server
81
 
which will proxy certain requests to the loggerhead server on the localhost.
82
 
To do this, you need to have PasteDeploy installed (see `Requirements`_).
83
 
Assuming that your server has Apache running, you need to add configuration
84
 
such as this to set up the proxy
85
 
 
86
 
::
87
 
 
88
 
    <Location "/loggerhead/">
89
 
        ProxyPass http://127.0.0.1:8080/
90
 
        ProxyPassReverse http://127.0.0.1:8080/
91
 
    </Location>
92
 
 
93
 
If your proxy runs at some path within the server, then the ``serve-branches``
94
 
command must be started with the ``--prefix`` option.  For this example, we
95
 
could start loggerhead with the command
96
 
 
97
 
::
98
 
 
99
 
  $ serve-branches --prefix=/loggerhead /srv/bzr
100
 
 
101
 
This would allow the trunk branch of ProjectX to be browsed at
102
 
``http://www.example.com/loggerhead/projectx/trunk``.
103
 
 
104
 
Loggerhead comes with a script allowing it to run as a service on init.d based
105
 
Linux systems.  Contributions to do a similar thing on Windows servers would
106
 
be welcomed at http://launchpad.net/loggerhead.
107
 
  
108
 
 
109
 
Other web interfaces
110
 
--------------------
111
 
 
112
 
There are a number of other web interfaces available for Bazaar branches (see
113
 
the list at http://bazaar-vcs.org/WebInterfaces) and we will just mention a
114
 
couple of them here for their advantages in particular situations.
115
 
 
116
 
trac+bzr (http://launchpad.net/trac-bzr)
117
 
  Trac is a popular web app that integrates a browser for branches, an issue
118
 
  tracker and a wiki.  trac+bzr is a trac extension that allows for the
119
 
  trac to be used with Bazaar.
120
 
 
121
 
webbzr (http://thoughts.enseed.com/webbzr)
122
 
  This is a notable solution because it is written in pure PHP for web hosts
123
 
  that don't provide a way to run arbitrary Python applications such as Trac
124
 
  or Loggerhead.
125
 
 
126
 
Redmine (http://redmine.org/)
127
 
  Like trac, Redmine is a full project management application using the Ruby
128
 
  on Rails framework.  It includes support for Bazaar branches.