Merge lp:~nmb/bzr/admin-guide into lp:bzr
- admin-guide
- Merge into bzr.dev
Status: | Rejected |
---|---|
Rejected by: | Ian Clatworthy |
Proposed branch: | lp:~nmb/bzr/admin-guide |
Merge into: | lp:bzr |
Diff against target: |
1335 lines (+1141/-116) 14 files modified
doc/en/admin-guide/advanced.txt (+160/-0) doc/en/admin-guide/backup.txt (+144/-0) doc/en/admin-guide/code-browsing.txt (+126/-0) doc/en/admin-guide/hooks-plugins.txt (+309/-0) doc/en/admin-guide/index.txt (+25/-114) doc/en/admin-guide/integration.txt (+14/-0) doc/en/admin-guide/introduction.txt (+57/-0) doc/en/admin-guide/migration.txt (+68/-0) doc/en/admin-guide/other-setups.txt (+60/-0) doc/en/admin-guide/security.txt (+9/-0) doc/en/admin-guide/simple-setups.txt (+92/-0) doc/en/admin-guide/upgrade.txt (+76/-0) doc/en/conf.py (+0/-2) doc/en/index.txt (+1/-0) |
To merge this branch: | bzr merge lp:~nmb/bzr/admin-guide |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Neil Martinsen-Burrell (community) | Needs Resubmitting | ||
Vincent Ladeuil | Needs Fixing | ||
Review via email: mp+15725@code.launchpad.net |
Commit message
Description of the change
Neil Martinsen-Burrell (nmb) wrote : | # |
Neil Martinsen-Burrell (nmb) wrote : | # |
Also this currently isn't accessible anywhere from doc/en/index.txt, but that is also an orthogonal change, although one that should be made soon after merging this. But, that really needs the attention of someone who knows what they want the doc website to look like. Ian?
Vincent Ladeuil (vila) wrote : | # |
Impressive work !
But its size makes it quite hard to review :-/
Could you instead make several merge proposals starting with the
one that introduce the new layout and then one for each
significant topic (look at the prerequisite branch when making
these proposals) ?
Ideally each of one would then represent a ~100-300 lines diff
and be easier to review and provide timely and constructive
feedback. If you could end up with say 5 proposals instead of
this big one, I think we'll be in a better position to land
quickly most of them and let discussions happen where needed.
To keep the ball rolling, here are some remarks anyway:
- I agree the admin guide needs an entry at the root level,
- the html files doesn't seem to be generated by 'make docs',
including that in the first mp would be good
- I don't think the migration chapter should stay here, I think
it deserves its own guide and also its own entry at the root
level.
Neil Martinsen-Burrell (nmb) wrote : | # |
Will do. Resubmitting as six separate merge proposals with smaller diffs.
Ian Clatworthy (ian-clatworthy) wrote : | # |
I'll make this patch as rejected as it's been superseded by the smaller patches.
Preview Diff
1 | === added file 'doc/en/admin-guide/advanced.txt' |
2 | --- doc/en/admin-guide/advanced.txt 1970-01-01 00:00:00 +0000 |
3 | +++ doc/en/admin-guide/advanced.txt 2009-12-07 03:05:25 +0000 |
4 | @@ -0,0 +1,160 @@ |
5 | +Advanced Topics |
6 | +=============== |
7 | + |
8 | +System Monitoring |
9 | +----------------- |
10 | + |
11 | +Capacity Planning Tips |
12 | +---------------------- |
13 | + |
14 | +Clustering |
15 | +---------- |
16 | + |
17 | +Multi-site Setups |
18 | +----------------- |
19 | + |
20 | +The "distributed" in distributed version control system should indicate that |
21 | +Bazaar is well suited for multi-site development situations and indeed, that |
22 | +is the case. The advantage comes from the ease and transparency of managing |
23 | +merges between branches with divergent history. Note that there are many, |
24 | +many different ways to manage widely-flung development setups using Bazaar and |
25 | +its branching and merging capabilities. These can be discovered and tested |
26 | +before being implemented as policy. We will describe one such possible setup |
27 | +here. |
28 | + |
29 | +Consider ProjectX Corp's international expansion with a new branch office in |
30 | +Darwin, Australia, in addition to the company's headquarters in Paris, Texas, |
31 | +USA. One of the difficulties of a far-flung multi-site development |
32 | +environment such as this is that the network connection between Australia and |
33 | +Texas is slow and unreliable. So, each branch office would like the master |
34 | +branch to be local to them. (In situations with good network connectivity, a |
35 | +local branch bound to the remote master may be all that is needed to support |
36 | +multi-site development.) |
37 | + |
38 | +Of course, with two master branches, there is always the question of which one |
39 | +is authoritative. Given Bazaar's facility at managing multiple branches, we |
40 | +suggest that it is best not to privilege either the Texas or Australia |
41 | +branches, but to merge both of them into a separate master branch (which may |
42 | +reside at either site). For definiteness, we will locate the master branch at |
43 | +the Texas site. So, we will have three branches stored on two servers: |
44 | +trunk-master and trunk-texas at the Texas site and trunk-australia at the |
45 | +Darwin site. |
46 | + |
47 | +Setup |
48 | +~~~~~ |
49 | + |
50 | +Using our previous setup at the Texas site, we will simply rename the old |
51 | +trunk branch as trunk-master and branch a copy as trunk-texas. |
52 | + |
53 | +:: |
54 | + |
55 | + $ cd /srv/bzr/projectx |
56 | + $ mv trunk trunk-master # can simply rename on the filesystem |
57 | + $ bzr branch trunk-master trunk-texas # very fast in a shared repository |
58 | + |
59 | +In Australia, we need to set up the ``/srv/bzr/projectx`` directory and get a |
60 | +copy of the current trunk as trunk-australia:: |
61 | + |
62 | + $ mkdir -p /srv/bzr |
63 | + $ cd /srv/bzr |
64 | + $ bzr init-repo --no-trees projectx |
65 | + $ cd projectx |
66 | + $ bzr branch bzr+ssh://server.example.com/srv/bzr/trunk-master |
67 | + $ bzr branch trunk-master trunk-australia |
68 | + |
69 | +Merging to master |
70 | +~~~~~~~~~~~~~~~~~ |
71 | + |
72 | +Then, each office works with their local copy of the trunk. At some point, |
73 | +sooner or later depending on the pace of development in the two locations, the |
74 | +two local trunks need to be merged. (In general, sooner beats later when |
75 | +merging, since there is no penalty for multiple merges.) In this example, |
76 | +Alice at the Texas office will do the merging on her local machine using |
77 | +branches on the server:: |
78 | + |
79 | + # Get a copy of the Australia branch in Texas. After the initial branch |
80 | + # command, use pull to keep the branch up to date. With a slow network, |
81 | + # this is the only slow part |
82 | + $ bzr branch bzr+ssh://autralia.example.com/srv/bzr/projectx/trunk-australia \ |
83 | + bzr+ssh://server.example.com/srv/bzr/projectx/trunk-australia |
84 | + |
85 | + # Check out the master branch locally for doing the merge |
86 | + $ cd ~/projectx |
87 | + $ bzr checkout bzr+ssh://server.example.com/srv/bzr/projectx/trunk-master |
88 | + $ cd trunk-master |
89 | + $ bzr merge bzr+ssh://server.example.com/srv/bzr/projectx/trunk-texas |
90 | + # Run the test suite and resolve any conflicts |
91 | + $ bzr commit -m "Merge Texas branch to master" |
92 | + |
93 | + # Now, merge from Australia using the local copy of that branch |
94 | + $ bzr merge bzr+ssh://server.example.com/srv/bzr/projectx/trunk-australia |
95 | + # Run the test suite and resolve any conflicts between the two offices |
96 | + $ bzr commit -m "Merge Australia branch to master" |
97 | + |
98 | +Note that Bazaar does not commit even cleanly applied merges by default. This |
99 | +is because although a merge may apply cleanly, the merged state still needs to |
100 | +be checked before it is committed. (Just because there are no text conflicts |
101 | +does not mean that everything will work after a merge.) If it is desired to |
102 | +automatically commit when possible, use ``bzr merge --pull``. |
103 | + |
104 | +Merging back to local trunks |
105 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
106 | + |
107 | +Now the trunk-master branch is the most up-to-date version of the software and |
108 | +both of the local trunks need to reincorporate the changes from the master. |
109 | +If no new commits have been made to trunk-texas, then that can happen using |
110 | +``bzr pull``:: |
111 | + |
112 | + $ cd ~/projectx |
113 | + $ bzr checkout bzr+ssh://server.example.com/srv/bzr/projectx/trunk-texas |
114 | + $ cd trunk-texas |
115 | + $ bzr pull ../trunk-master # Use trunk-master from the local disk |
116 | + # No need to commit |
117 | + |
118 | +If new changes have happened on trunk-texas since the integration with |
119 | +trunk-master, then the above pull will produce an error suggesting to use |
120 | +merge:: |
121 | + |
122 | + $ bzr merge ../trunk-master |
123 | + # Run test suite, resolve conflicts |
124 | + $ bzr commit -m "Merging Australian changes" |
125 | + |
126 | +In Australia, they will need to update their local copy of trunk-master:: |
127 | + |
128 | + $ cd /srv/bzr/projectx/trunk-master |
129 | + $ bzr pull # parent location is used by default |
130 | + |
131 | +Then, they need to pull or merge the changes from trunk-master into the local |
132 | +trunk. This should be done by a developer with a checkout of trunk-australia |
133 | +so that they can run the test suite:: |
134 | + |
135 | + $ cd ~/projectx |
136 | + $ bzr co bzr+ssh://australia.example.com/srv/bzr/projectx/trunk-australia |
137 | + $ cd trunk-australia |
138 | + $ bzr merge bzr+ssh://australia.example.com/srv/bzr/projectx/trunk-master |
139 | + # Run test suite and integrate Texan changes with only recent local |
140 | + # development |
141 | + $ bzr commit -m "Integrate work from Texas" |
142 | + |
143 | + |
144 | +Other Considerations |
145 | +~~~~~~~~~~~~~~~~~~~~ |
146 | + |
147 | +Multi-site deployments can be complicated, due to the many possible variations |
148 | +of development velocity, divisions of labor, network connectivity, resources |
149 | +for integration, etc. The preceding description is meant to be one possible |
150 | +way to do fairly symmetric multi-site development. (Neither Texas or |
151 | +Australia is privileged in this structure.) In a situation where there is one |
152 | +main site and other smaller sites, one of the local trunk branches can be |
153 | +eliminated and trunk-master can be used directly for development at the main |
154 | +site. |
155 | + |
156 | +It is also up to the particular situation how frequently the local trunks are |
157 | +integrated into the master trunk. Given resources specifically for |
158 | +integration, it is conceivable that a developer may be constantly responsible |
159 | +for integrating changes from the two teams. Alternatively, the two sites |
160 | +could work on well-separated, well-defined features and merge to the master |
161 | +trunk only when their respective features are complete. Given the difficulty |
162 | +of resolving conflicts in very large merges and the ease of merge handling in |
163 | +Bazaar, we suggest that merges be done more frequently, rather than less. |
164 | +more frequently |
165 | |
166 | === added file 'doc/en/admin-guide/backup.txt' |
167 | --- doc/en/admin-guide/backup.txt 1970-01-01 00:00:00 +0000 |
168 | +++ doc/en/admin-guide/backup.txt 2009-12-07 03:05:25 +0000 |
169 | @@ -0,0 +1,144 @@ |
170 | +Back-up and Restore |
171 | +=================== |
172 | + |
173 | +Backing up Bazaar branches can be done in two different ways. If an existing |
174 | +filesystem-based backup scheme already exists, then it can easily be used |
175 | +where the Bazaar branches reside. Alternately, Bazaar itself can be used to |
176 | +mirror the desired branches to or from another location for backup purposes. |
177 | + |
178 | +Filesystem Backups |
179 | +------------------ |
180 | + |
181 | +Bazaar transactions are atomic in the sense that the disk format is such that |
182 | +it is in a valid state at all times. If a Bazaar file is copied while some |
183 | +process is in the midst of writing to that file, then that content is not |
184 | +referred to by the other on-disk structures until the data is completely |
185 | +written. As such, it should be safe to copy Bazaar branches using filesystem |
186 | +tools at any time. The only possible drawback to doing this is that the |
187 | +copied files may contain a small amount of additional content that isn't used |
188 | +elsewhere in the branch. A later copy made after that change has fully |
189 | +completed would contain that whole change. Bazaar's disk formats are not |
190 | +specifically tuned to be kind to tape backup methods that prefer to append to |
191 | +existing files, but they should be reasonably friendly in that regard. (In |
192 | +many cases, they do only append to files that already exist.) |
193 | + |
194 | + |
195 | +Bazaar as its own backup |
196 | +------------------------ |
197 | + |
198 | +The features that make Bazaar a good distributed version control system also |
199 | +make it a good choice for backing itself up. In particular, complete and |
200 | +consistent copies of any branch can easily be obtained with the ``branch`` and |
201 | +``pull`` commands. As a result, a backup process can simply run ``bzr pull`` |
202 | +on a copy of the main branch to fully update that copy. If this backup |
203 | +process runs periodically, then the backups will be as current as the last |
204 | +time that ``pull`` was run. (This is in addition to the fact |
205 | +that revisions are immutable in Bazaar so that a prior revision of a branch is |
206 | +always recoverable from that branch when the revision id is known.) |
207 | + |
208 | +As an example, consider a separate backup server that stores backups in |
209 | +``/var/backup``. On that server, we could initially run |
210 | + |
211 | +:: |
212 | + |
213 | + $ cd /var/backup |
214 | + $ bzr branch bzr+ssh://server.example.com/srv/bzr/trunk |
215 | + $ bzr branch bzr+ssh://server.example.com/srv/bzr/feature-gui |
216 | + |
217 | +to create the branches on the backup server. Then, we could regularly (for |
218 | +example from ``cron``) do |
219 | + |
220 | +:: |
221 | + |
222 | + $ cd /var/backup/trunk |
223 | + $ bzr pull # the location to pull from is remembered |
224 | + $ cd ../var/backup/feature-gui |
225 | + $ bzr pull # again, the parent location is remembered |
226 | + |
227 | +The action of pulling from the parent for all branches in some directory is |
228 | +common enough that there is a plugin to do it. The `bzrtools`_ plugin |
229 | +contains a ``multi-pull`` command that does a ``pull`` in all branches under a |
230 | +specified directory. |
231 | + |
232 | +.. _bzrtools: http://launchpad.net/bzrtools |
233 | + |
234 | +With this plugin installed, the above periodically run commands would be |
235 | + |
236 | +:: |
237 | + |
238 | + $ cd /var/backup |
239 | + $ bzr multi-pull |
240 | + |
241 | +Note that ``multi-pull`` does a pull in *every* branch in the specified |
242 | +directory (the current directory by default) and care should be taken that |
243 | +this is the desired effect. A simple script could also substitute for the |
244 | +multi-pull command while also offering greater flexibility. |
245 | + |
246 | +Bound Branch Backups |
247 | +~~~~~~~~~~~~~~~~~~~~ |
248 | + |
249 | +When ``bzr pull`` is run regularly to keep a backup copy up to date, then it |
250 | +is possible that there are new revisions in the original branch that have not |
251 | +yet been pulled into the backup branch. To alleviate this problem, we can set |
252 | +the branches up so that new revisions are *pushed* to the backup rather than |
253 | +periodically pulling. One way to do this is using Bazaar's concept of bound |
254 | +branches, where a commit in one branch happens only when the same commit |
255 | +succeeds in the branch to which it is `bound`. As a push-type technology, it |
256 | +is set up on the server itself rather than on the backup machine. For each |
257 | +branch that should be backed up, you just need to use the ``bind`` command to |
258 | +set the URL for the backup branch. In our example, we first need to create |
259 | +the branches on the backup server (we'll use ``bzr push``, but we could as |
260 | +easily have used ``bzr branch`` from the backup server) |
261 | + |
262 | +:: |
263 | + $ cd /srv/bzr/projectx/trunk |
264 | + $ bzr push bzr+ssh://backup.example.com/var/backup//trunk |
265 | + $ cd ../feature-gui |
266 | + $ bzr push bzr+ssh://backup.example.com/var/backup/feature-gui |
267 | + |
268 | +and then we need to bind the main branches to their backups |
269 | + |
270 | +:: |
271 | + |
272 | + $ cd ../trunk |
273 | + $ bzr bind bzr+ssh://backup.example.com/var/backup/trunk |
274 | + $ cd ../feature-gui |
275 | + $ bzr bind bzr+ssh://backup.example.com/var/backup/feature-gui |
276 | + |
277 | +A branch can only be bound to a single location, so if multiple backups are |
278 | +desired, then the branches must be chained. For example on the backup server, |
279 | +we could bind the backup branches to a separate, remote backup |
280 | + |
281 | +:: |
282 | + |
283 | + $ cd /var/backup/trunk |
284 | + $ bzr push bzr+ssh://offsite.example.org/projectx-corp/backup/trunk |
285 | + $ bzr bind bzr+ssh://offsite.example.org/projectx-corp/backup/trunk |
286 | + $ cd ../feature-gui |
287 | + $ bzr push bzr+ssh://offsite.example.org/projectx-corp/backup/feature-gui |
288 | + $ bzr bind bzr+ssh://offsite.example.org/projectx-corp/backup/feature-gui |
289 | + |
290 | +Using the `automirror`_ plugin mentioned under `Hooks and Plugins <hooks-plugins.html>`_, one can |
291 | +also make a push-type backup system that more naturally handles mutliple |
292 | +backups. Simply set the ``post_commit_mirror`` option to multiple URLs |
293 | +separated by commas. Replicating the above example would mean doing |
294 | + |
295 | +:: |
296 | + |
297 | + $ cd /srv/bzr/trunk |
298 | + $ echo "post_commit_mirror=bzr+ssh://backup.example.com/var/backup/trunk,\ |
299 | + bzr+ssh://offsite.example.org/projectx-corp/backup/trunk" >> .bzr/branch/branch.conf |
300 | + $ cd ../feature-gui |
301 | + $ echo "post_commit_mirror=bzr+ssh://backup.example.com/var/backup/feature-gui,\ |
302 | + bzr+ssh://offsite.example.org/projectx-corp/backup/feature-gui" >> .bzr/branch/branch.conf |
303 | + |
304 | +.. _automirror: http://launchpad.net/bzr-automirror |
305 | + |
306 | +As for any push-type backup strategy that maintains consistency, the downside |
307 | +of these methods is that all of the backup commits must succeed before the |
308 | +initial commit can succeed. If there is a long chain of bound branches, many |
309 | +mirror branches, or if the bound branch has a slow network connection, then |
310 | +the delay in the original commit may be unacceptably long. In this case, |
311 | +pull-type backups, or a mixed system may be preferable. |
312 | + |
313 | + |
314 | |
315 | === added file 'doc/en/admin-guide/code-browsing.txt' |
316 | --- doc/en/admin-guide/code-browsing.txt 1970-01-01 00:00:00 +0000 |
317 | +++ doc/en/admin-guide/code-browsing.txt 2009-12-07 03:05:25 +0000 |
318 | @@ -0,0 +1,126 @@ |
319 | +Web-based code browsing |
320 | +======================= |
321 | + |
322 | +Browsing the history of a project online is an important part of version |
323 | +control, since it allows people to easily see what happens in a branch |
324 | +without having to have a local, up-to-date copy of that branch. There are a |
325 | +number of possible choices for browsing Bazaar branches on the web, but we |
326 | +will cover one of them in particular detail and briefly mention the other |
327 | +choices where they differ. |
328 | + |
329 | +Loggerhead |
330 | +---------- |
331 | + |
332 | +Loggerhead is a code browsing interface for Bazaar branches (originally |
333 | +developed for Launchpad). To see an example of Loggerhead in action, browse |
334 | +to http://bazaar.launchpad.net/~bzr-pqm/bzr/bzr.dev/files which is the |
335 | +loggerhead view of Bazaar's trunk branch. Loggerhead runs as a web |
336 | +application on the server which is accessed over HTTP via a RESTful interface. |
337 | +It is possible to run this application on its own dedicated port as |
338 | +``http://www.example.com:8080`` or to proxy this location behind a separate |
339 | +web server, for example at ``http://www.example.com/loggerhead/``. We will |
340 | +discuss both of these configurations below. |
341 | + |
342 | +Requirements |
343 | +~~~~~~~~~~~~ |
344 | + |
345 | +Loggerhead depends on a number of other Python packages for the various Web |
346 | +technologies that it builds on. Some of these must be installed to use |
347 | +loggerhead, although some of them are optional. From the loggerhead `README` |
348 | +file, these are |
349 | + |
350 | +1) SimpleTAL for templating. |
351 | + On Ubuntu, `sudo apt-get install python-simpletal` |
352 | + or download from http://www.owlfish.com/software/simpleTAL/download.html |
353 | +2) simplejson for producing JSON data. |
354 | + On Ubuntu, `sudo apt-get install python-simplejson` |
355 | + or use `easy_install simplejson`. |
356 | +3) Paste for the server. (You need version 1.2 or newer of Paste.) |
357 | + On Ubuntu, `sudo apt-get install python-paste` |
358 | + or use `easy_install Paste` |
359 | +4) Paste Deploy (optional, needed when proxying through Apache) |
360 | + On Ubuntu, `sudo apt-get install python-pastedeploy` |
361 | + or use `easy_install PasteDeploy` |
362 | +5) flup (optional, needed to use FastCGI, SCGI or AJP) |
363 | + On Ubuntu, `sudo apt-get install python-flup` |
364 | + or use `easy_install flup` |
365 | + |
366 | +Although directions for installing these on Ubuntu Linux are given, most other |
367 | +Linux distributions should package these dependencies, making installation |
368 | +easy. For Windows and Mac OS X, the should all be ``easy_install``-able or at |
369 | +worst installable from the Python sources. |
370 | + |
371 | +Built-in Web Server |
372 | +~~~~~~~~~~~~~~~~~~~ |
373 | + |
374 | +Loggerhead has a built-in web server and when started with the |
375 | +``serve-branches`` command, that web server is started on a default port |
376 | +listening on the localhost. If port 8080 (the default) is accessible on |
377 | +``www.example.com``, then running |
378 | + |
379 | +:: |
380 | + |
381 | + $ serve-branches --host=www.example.com --port=8080 /srv/bzr |
382 | + |
383 | +will list all of the available branches under that directory on |
384 | +``http://www.example.com:8080/``, so that the ProjectX trunk could be browsed |
385 | +at ``http://www.example.com:8080/projectx/trunk``. Note that loggerhead |
386 | +provides HTTP access to the underlying Bazaar branches (similar to that |
387 | +described in `Smart server over HTTP(S) |
388 | +<other-setups.html#smart-server-over-http-s>`_), so this command should be run |
389 | +as a user without write privileges in ``/srv/bzr``. By default, loggerhead |
390 | +only listens on the localhost, not any external ports, unless specified as |
391 | +above. |
392 | + |
393 | +Behind a Proxy |
394 | +~~~~~~~~~~~~~~ |
395 | + |
396 | +A more common and more safe way to run loggerhead is behind another web server |
397 | +which will proxy certain requests to the loggerhead server on the localhost. |
398 | +To do this, you need to have PasteDeploy installed (see `Requirements`_). |
399 | +Assuming that your server has Apache running, you need to add configuration |
400 | +such as this to set up the proxy |
401 | + |
402 | +:: |
403 | + |
404 | + <Location "/loggerhead/"> |
405 | + ProxyPass http://127.0.0.1:8080/ |
406 | + ProxyPassReverse http://127.0.0.1:8080/ |
407 | + </Location> |
408 | + |
409 | +If your proxy runs at some path within the server, then the ``serve-branches`` |
410 | +command must be started with the ``--prefix`` option. For this example, we |
411 | +could start loggerhead with the command |
412 | + |
413 | +:: |
414 | + |
415 | + $ serve-branches --prefix=/loggerhead /srv/bzr |
416 | + |
417 | +This would allow the trunk branch of ProjectX to be browsed at |
418 | +``http://www.example.com/loggerhead/projectx/trunk``. |
419 | + |
420 | +Loggerhead comes with a script allowing it to run as a service on init.d based |
421 | +Linux systems. Contributions to do a similar thing on Windows servers would |
422 | +be welcomed at http://launchpad.net/loggerhead. |
423 | + |
424 | + |
425 | +Other web interfaces |
426 | +-------------------- |
427 | + |
428 | +There are a number of other web interfaces available for Bazaar branches (see |
429 | +the list at http://bazaar-vcs.org/WebInterfaces) and we will just mention a |
430 | +couple of them here for their advantages in particular situations. |
431 | + |
432 | +trac+bzr (http://launchpad.net/trac-bzr) |
433 | + Trac is a popular web app that integrates a browser for branches, an issue |
434 | + tracker and a wiki. trac+bzr is a trac extension that allows for the |
435 | + trac to be used with Bazaar. |
436 | + |
437 | +webbzr (http://thoughts.enseed.com/webbzr) |
438 | + This is a notable solution because it is written in pure PHP for web hosts |
439 | + that don't provide a way to run arbitrary Python applications such as Trac |
440 | + or Loggerhead. |
441 | + |
442 | +Redmine (http://redmine.org/) |
443 | + Like trac, Redmine is a full project management application using the Ruby |
444 | + on Rails framework. It includes support for Bazaar branches. |
445 | |
446 | === added file 'doc/en/admin-guide/hooks-plugins.txt' |
447 | --- doc/en/admin-guide/hooks-plugins.txt 1970-01-01 00:00:00 +0000 |
448 | +++ doc/en/admin-guide/hooks-plugins.txt 2009-12-07 03:05:25 +0000 |
449 | @@ -0,0 +1,309 @@ |
450 | +Extending Bazaar with Hooks and Plugins |
451 | +======================================= |
452 | + |
453 | +Bazaar offers a powerful extension mechanism for adding capabilities. In |
454 | +addition to offering full library API access to all of its structures, which |
455 | +can be useful for outside programs that would like to interact with Bazaar |
456 | +branches, Bazaar can also load *plugins* that perform specific tasks. These |
457 | +specific tasks are specified by *hooks* that run during certain steps of the |
458 | +version control process. |
459 | + |
460 | +For full documentation on the available hooks, see ``bzr help hooks``. Among |
461 | +those, some of the most significant hooks from an administration |
462 | +standpoint are `pre_commit`, `post_commit` and `post_change_branch_tip`. |
463 | +A `pre_commit` hook can inspect a commit before it happens and cancel it if |
464 | +some criteria are not met. This can be useful for enforcing policies about |
465 | +the code, such as line-endings or whitespace conventions. A |
466 | +`post_commit` hook can take actions based on the commit that just happened, |
467 | +such as providing various types of notifications. Finally, a |
468 | +`post_change_branch_tip` hook is a more general form of a `post_commit` |
469 | +hook which is used whenever the tip of a branch changes (which can happen in |
470 | +more ways than just committing). This too can be used for notification |
471 | +purposes, as well as for backups and mirroring. |
472 | + |
473 | +Information on the whole range of Bazaar plugins is available at |
474 | +http://doc.bazaar-vcs.org/en/plugin-guide. For purposes of installation, |
475 | +plugins are simply python packages. They can be installed alongside Bazaar in |
476 | +the ``bzrlib.plugins`` package using each plugin's ``setup.py``. They can |
477 | +also be installed in the plugin path which is the user's ``~/.bazaar/plugins`` |
478 | +directory or can be specified with the ``BZR_PLUGIN_PATH`` environment |
479 | +variable. See ``bzr help configuration`` for more on specifying the location |
480 | +of plugins. |
481 | + |
482 | + |
483 | +Email Notification |
484 | +------------------ |
485 | + |
486 | +A common need is for every change made on a branch to send an email message to |
487 | +some address, most often a mailing list. These plugins provide that |
488 | +capability in a number of different ways. The `email` plugin sends email |
489 | +from each individual developer's computer. This can be useful for situations |
490 | +that want to track what each individual developer is working on. On the |
491 | +downside, it requires that every developer's branches be configured |
492 | +individually to use the same plugin. The next two plugins `hookless-email` |
493 | +and `email-notifier` are designed to run on a central server whenever changes |
494 | +happen on centrally stored branches. |
495 | + |
496 | |
497 | +~~~~~ |
498 | + |
499 | +To configure this plugin, simply install the plugin and configure the |
500 | +``post_commit_to`` option for each branch. This configuration can be done |
501 | +in the ``locations.conf`` file or individually in each branch's |
502 | +``branch.conf`` file. The sender's email address can be specified as |
503 | +``post_commit_sender`` if it is different than the email address reported by |
504 | +``bzr whoami``. The ``post_commit_mailer`` option specifies how the |
505 | +mail should be sent. If it isn't set, email is sent via ``/usr/bin/mail``. |
506 | +It can also be configured to communicate directly with an SMTP server. |
507 | +For more details on configuring this plugin, see |
508 | +http://doc.bazaar-vcs.org/plugins/en/email-plugin.html. As examples, consider |
509 | +the following two possible configurations. A minimal one (uses |
510 | +``/usr/bin/mail``) |
511 | + |
512 | +:: |
513 | + |
514 | + [DEFAULT] |
515 | + post_commit_to = projectx-commits@example.com |
516 | + |
517 | +and a more complicated one (using all of the options) |
518 | + |
519 | +:: |
520 | + |
521 | + [DEFAULT] |
522 | + post_commit_url = http://www.example.com/code/projectx/trunk |
523 | + post_commit_to = projectx-commits@example.com |
524 | + post_commit_sender = donotreply@example.com |
525 | + post_commit_mailer = smtplib |
526 | + smtp_server = mail.example.com:587 |
527 | + smtp_username = bob |
528 | + # smtp_password = 'not specified, will prompt' |
529 | + |
530 | + |
531 | +hookless-email |
532 | +~~~~~~~~~~~~~~ |
533 | + |
534 | +This plugin is basically a server-side version of the `email` plugin. It is |
535 | +a program that runs either from the command line or as a daemon that monitors |
536 | +the branches specified on the command line for any changes. When a change |
537 | +occurs to any of the monitored branches, it will send an email to the |
538 | +specified address. Using our simple example, the following command would send |
539 | +an email to ``projectx-commits@example.com`` on any of the branches under |
540 | +``/srv/bzr`` since the last time the command was run. (This command could be |
541 | +set up to run at regular intervals, for example from ``cron``.) |
542 | + |
543 | +:: |
544 | + |
545 | + $ bzr_hookless_email.py --email=projectx-commits@example.com \ |
546 | + --recurse /srv/bzr |
547 | + |
548 | +email-notifier |
549 | +~~~~~~~~~~~~~~ |
550 | + |
551 | +This is a more elaborate version of the `hookless-email` plugin that can send |
552 | +templated HTML emails, render wiki-style markup in commit messages and update |
553 | +working copies on the server (similar to `push_and_update`_). It can also |
554 | +send emails reporting the creation of new branches or the removal of branches |
555 | +under a specified directory (here ``/srv/bzr/projectx``). As it is more |
556 | +complicated, its configuration is also more complicated and we won't repeat |
557 | +its documentation here, but a simple configuration that will send emails on |
558 | +commits and creation/deletion of branches is |
559 | + |
560 | +:: |
561 | + |
562 | + [smtp] |
563 | + |
564 | + server=smtp.example.com |
565 | + # If user is not provided then no authentication will be performed. |
566 | + user=bob |
567 | + password=pAssW0rd |
568 | + |
569 | + [commits] |
570 | + |
571 | + # The address to send commit emails to. |
572 | + to=projctx-commits@example.com |
573 | + from=$revision.committer |
574 | + |
575 | + # A Cheetah template used to construct the subject of the email message. |
576 | + subject=$relative_path: $revision_number $summary |
577 | + |
578 | + [new-branches] |
579 | + to=projectx-commits@example.com |
580 | + from=donotreply@example.com |
581 | + subject=$relative_path: New branch created |
582 | + |
583 | + [removed-branches] |
584 | + to=projectx-commits@example.com |
585 | + from=donotreply@example.com |
586 | + subject=$relative_path: Branch removed |
587 | + |
588 | +If this file is stored as ``/srv/bzr/email-notifier.conf``, then the command |
589 | + |
590 | +:: |
591 | + |
592 | + $ bzr-email-notifier.py --config=/srv/bzr/email-notifier.conf /srv/bzr/projectx |
593 | + |
594 | +will watch all branches under the given directory for commits, branch |
595 | +creations and branch deletions. |
596 | + |
597 | + |
598 | +Feed Generation |
599 | +--------------- |
600 | + |
601 | +A related concept to sending out emails when branches change is the generation |
602 | +of news feeds from changes on each branch. Interested parties can then choose |
603 | +to follow those news feeds in order to see what is happening on a branch. |
604 | + |
605 | +branchfeed |
606 | +~~~~~~~~~~ |
607 | + |
608 | +This plugin creates an ATOM feed for every branch on every branch change |
609 | +(commit, etc.). It stores these files as ``.bzr/branch/branch.atom`` inside |
610 | +each branch. Currently, it includes the 20 most recent changes in each feed. |
611 | +To use it, simply install the plugin and set your feed reader to follow the |
612 | +``branch.atom`` files. |
613 | + |
614 | +In addition, there are other tools that are not plugins for creating news |
615 | +feeds from Bazaar branches. See http://bazaar-vcs.org/FeedGenerators for more |
616 | +on those tools. |
617 | + |
618 | +Mirroring |
619 | +--------- |
620 | + |
621 | +Sometimes it is useful to ensure that one branch exists as an exact copy of |
622 | +another. This can be used to provide simple backup facilities or redundancy |
623 | +(see `Back-up and restore <backup.html>`_ for more details on backups). One |
624 | +way to do this using Bazaar's workflows is to make the branch where changes |
625 | +happen into a bound branch of the mirror branch. Then, when commits happen on |
626 | +the working branch, they will also happen on the mirror branch. It is possible |
627 | +to make a chain of bound branches to create multiple mirrors. Note that |
628 | +commits to bound branches do *not* update the mirror branch's working copy, so |
629 | +if the mirror branch is more than just a backup of the complete history of the |
630 | +branch, for example if it is being served as a web page, then additional |
631 | +plugins are necessary. |
632 | + |
633 | +push_and_update |
634 | +~~~~~~~~~~~~~~~ |
635 | + |
636 | +This plugin updates Bazaar's ``push`` command to also update the remote |
637 | +working copy. It can only work over connections that imply filesystem or SSH |
638 | +access to the remote working copy (``bzr+ssh://``, ``sftp://`` and |
639 | +``file://``). Also, it is only useful when the remote branch is updated with |
640 | +an explicit ``push`` command. |
641 | + |
642 | +.. TODO: check that the list of URLs is correct |
643 | + |
644 | +automirror |
645 | +~~~~~~~~~~ |
646 | + |
647 | +This plugin is similar to `push_and_update` in that it updates the working |
648 | +copy of a remote branch. The difference is that this plugin is designed to |
649 | +update the remote branch on every change to the working branch. To configure |
650 | +this, set the ``post_commit_mirror = URL`` option on a branch. This option |
651 | +can include multiple branch URLs separated by commas to create multiple |
652 | +mirrors. For example, if we want to mirror our ``/srv/bzr/projectx/trunk`` |
653 | +branch to the URL ``sftp://www.example.com/var/www/projectx`` (for example if |
654 | +ProjectX were a web project that we wanted to access at |
655 | +``http://www.example.com/projectx``), then we could include |
656 | + |
657 | +:: |
658 | + |
659 | + [DEFAULT] |
660 | + post_commit_mirror = sftp://www.example.com/var/www/branches/trunk |
661 | + |
662 | +in the file ``/srv/bzr/projectx/trunk/.bzr/branch/branch.conf``. |
663 | + |
664 | + |
665 | +Other Useful Plugins |
666 | +-------------------- |
667 | + |
668 | +pqm (plugin) |
669 | +~~~~~~~~~~~~ |
670 | + |
671 | +Discussed further under `PQM <integration.html#patch-queue-manager-pqm>`_, this |
672 | +plugin submits each commit on a branch to the Patch Queue Manager, which can |
673 | +run the test suite before committing that revision to another branch. |
674 | + |
675 | +testrunner |
676 | +~~~~~~~~~~ |
677 | + |
678 | +Sometimes referred to as the poor man's PQM, this plugin runs a single command |
679 | +on the updated revision (in a temporary directory) and if the command returns |
680 | +0, then the revision can be committed to that branch. For example, if the |
681 | +testsuite is run with the command ``nosetests`` in the root of the branch |
682 | +(which returns 0 if the test suite passes and 1 if it doesn't pass), then one |
683 | +can set |
684 | + |
685 | +:: |
686 | + |
687 | + [DEFAULT] |
688 | + pre_change_branch_tip_test_command = nosetests |
689 | + |
690 | +in ``.bzr/branch/branch.conf``. |
691 | + |
692 | +checkeol |
693 | +~~~~~~~~ |
694 | + |
695 | +This plugin is an example of a `pre_commit` hook that checks the revision |
696 | +being committed for meeting some policy. In this case, it checks that all of |
697 | +the files have the specified line endings. It uses a configuration file |
698 | +``.bzreol`` in the root of the working tree (similar to the ``.bzrignore`` |
699 | +file). This configuration file has sections for line feed endings (LF), |
700 | +carriage return/line-feed endings (CRLF) and carriage return endings (CR). |
701 | +For an unusual example that specifies different line endings for different |
702 | +files, that file might look like |
703 | + |
704 | +:: |
705 | + |
706 | + [LF] |
707 | + *.py |
708 | + *.[ch] |
709 | + |
710 | + [CRLF] |
711 | + *.txt |
712 | + *.ini |
713 | + |
714 | + [CR] |
715 | + foo.mac |
716 | + |
717 | +or if you simply want to enforce a single line ending convention on the branch |
718 | +you can use |
719 | + |
720 | +:: |
721 | + |
722 | + [LF] |
723 | + * |
724 | + |
725 | +This plugin needs to be installed on the server where the branch updates will |
726 | +happen, and the ``.bzreol`` file must be in each branch where line ending |
727 | +policies will be enforced. (Adding it to the branch with ``bzr add .bzreol`` |
728 | +is an easy way to ensure this, although it means that branches on the server |
729 | +must have working trees.) |
730 | + |
731 | +text_checker |
732 | +~~~~~~~~~~~~ |
733 | + |
734 | +This plugin is a more advanced version of `checkeol` that can check such |
735 | +coding style guidelines such as trailing whitespace, long lines and files that |
736 | +don't end with a newline. It is configured using Bazaar's built in rules |
737 | +specification in ``BZR_HOME/rules`` (see ``bzr help rules`` for more |
738 | +information. For different types of undesired changes, you can specify |
739 | +different types of actions. For example |
740 | + |
741 | +:: |
742 | + |
743 | + [name NEWS README] |
744 | + trailing_whitespace=fail |
745 | + long_lines=warn |
746 | + newline_at_eof=ignore |
747 | + |
748 | + [name *.py] |
749 | + tabs=fail |
750 | + long_line_length=78 |
751 | + long_lines=fail |
752 | + trailing_whitespace=fail |
753 | + |
754 | +will prevent changes from adding new trailing whitespace to the specified |
755 | +files and keep all python source files free of tabs and lines over 78 |
756 | +characters. To commit while violating these rules, one can pass the |
757 | +``--text-check-warn-only`` option to commit. |
758 | + |
759 | |
760 | === modified file 'doc/en/admin-guide/index.txt' |
761 | --- doc/en/admin-guide/index.txt 2008-03-05 16:38:20 +0000 |
762 | +++ doc/en/admin-guide/index.txt 2009-12-07 03:05:25 +0000 |
763 | @@ -1,114 +1,25 @@ |
764 | -========================== |
765 | -Bazaar Administrator Guide |
766 | -========================== |
767 | - |
768 | -Note: this is a work in progress! |
769 | - |
770 | -.. contents:: Table of contents |
771 | - :depth: 2 |
772 | - |
773 | -Introduction |
774 | -============ |
775 | - |
776 | -Introduction to administering a Bazaar server installation. |
777 | - |
778 | -Scope of this guide |
779 | -------------------- |
780 | - |
781 | -What you need to run a Bazaar server |
782 | ------------------------------------- |
783 | - |
784 | -Platform requirements etc |
785 | - |
786 | - |
787 | -Simple setup |
788 | -============ |
789 | - |
790 | -Smart server |
791 | ------------- |
792 | - |
793 | -Recommended tools |
794 | ------------------ |
795 | - |
796 | - |
797 | -Migration |
798 | -========= |
799 | - |
800 | -Migrating from another VCS. |
801 | - |
802 | -Legacy VCS to bzr sync. |
803 | - |
804 | - |
805 | -Hooks |
806 | -===== |
807 | - |
808 | - |
809 | -Web-based code browsing |
810 | -======================= |
811 | - |
812 | -Loggerhead etc. |
813 | - |
814 | - |
815 | -Integration with other tools |
816 | -============================ |
817 | - |
818 | -PQM |
819 | ---- |
820 | - |
821 | -Bug trackers |
822 | ------------- |
823 | - |
824 | -Continuous integration tools |
825 | ----------------------------- |
826 | - |
827 | -e.g. Cruise Control |
828 | - |
829 | -Bundle Buggy |
830 | ------------- |
831 | - |
832 | - |
833 | -Security |
834 | -======== |
835 | - |
836 | -Authentication |
837 | --------------- |
838 | - |
839 | -ACLs |
840 | ----- |
841 | - |
842 | - |
843 | -Back-up and restore |
844 | -=================== |
845 | - |
846 | - |
847 | -Upgrades |
848 | -======== |
849 | - |
850 | -Software upgrades |
851 | ------------------ |
852 | - |
853 | -Disk format upgrades |
854 | --------------------- |
855 | - |
856 | -Plugin upgrades |
857 | ---------------- |
858 | - |
859 | - |
860 | -System monitoring |
861 | -================= |
862 | - |
863 | - |
864 | -Capacity planning tips |
865 | -====================== |
866 | - |
867 | -Disk management etc. |
868 | - |
869 | - |
870 | -Advanced topics |
871 | -=============== |
872 | - |
873 | -Clustering |
874 | ----------- |
875 | - |
876 | -Multi-site setups |
877 | ------------------ |
878 | +################################### |
879 | +Bazaar System Administrator's Guide |
880 | +################################### |
881 | + |
882 | +.. Please mark sections in included files as following: |
883 | +.. level 1 ======== |
884 | +.. level 2 -------- |
885 | +.. level 3 ~~~~~~~~ |
886 | +.. level 4 ^^^^^^^^ (it is better not to use nesting deeper than 3 levels) |
887 | + |
888 | + |
889 | +.. toctree:: |
890 | + :maxdepth: 2 |
891 | + |
892 | + introduction |
893 | + simple-setups |
894 | + other-setups |
895 | + migration |
896 | + hooks-plugins |
897 | + code-browsing |
898 | + integration |
899 | + security |
900 | + backup |
901 | + upgrade |
902 | + advanced |
903 | |
904 | === added file 'doc/en/admin-guide/integration.txt' |
905 | --- doc/en/admin-guide/integration.txt 1970-01-01 00:00:00 +0000 |
906 | +++ doc/en/admin-guide/integration.txt 2009-12-07 03:05:25 +0000 |
907 | @@ -0,0 +1,14 @@ |
908 | +Integration with Other Tools |
909 | +============================ |
910 | + |
911 | +Patch Queue Manager (PQM) |
912 | +------------------------- |
913 | + |
914 | +Bug Trackers |
915 | +------------ |
916 | + |
917 | +Continuous Integration Tools |
918 | +---------------------------- |
919 | + |
920 | +Bundle Buggy |
921 | +------------ |
922 | |
923 | === added file 'doc/en/admin-guide/introduction.txt' |
924 | --- doc/en/admin-guide/introduction.txt 1970-01-01 00:00:00 +0000 |
925 | +++ doc/en/admin-guide/introduction.txt 2009-12-07 03:05:25 +0000 |
926 | @@ -0,0 +1,57 @@ |
927 | +Introduction |
928 | +============ |
929 | + |
930 | +Welcome to the Bazaar Version Control System's guide for system |
931 | +administrators. Bazaar is a flexible system that provides many possible |
932 | +options for serving projects, in ways that will hopefully meet your needs. If |
933 | +you have requirements that are not met by the current state of the Bazaar |
934 | +ecosystem, please let us know at bazaar@lists.canonical.com on on Launchpad at |
935 | +https://launchpad.net/bzr. |
936 | + |
937 | +Scope of this guide |
938 | +------------------- |
939 | + |
940 | +In this guide, we will discuss various techniques for making Bazaar projects |
941 | +available, migrating from other Version Control Systems, browsing code over |
942 | +the Web and combining Bazaar with other tools. In many of these categories, |
943 | +multiple options exist and we will try to explains the costs and benefits of |
944 | +the various options. |
945 | + |
946 | +The intended audience for this guide is the individuals who administer the |
947 | +computers that will do the serving. Much of the configuration that we will |
948 | +discuss requires administrator privileges and we will not necessarily indicate |
949 | +every point that those privileges are needed. That said, reading this guide |
950 | +can also be very helpful for those who are interested in communicating to the |
951 | +system administrators about the requirements for making full use of Bazaar. |
952 | + |
953 | +What you need to run a Bazaar server |
954 | +------------------------------------ |
955 | + |
956 | +Where possible, we will discuss both Unix (including Linux) and Windows server |
957 | +environments. For the purposes of this document, we will consider Mac OS X as |
958 | +a type of Unix. |
959 | + |
960 | +In general, Bazaar requires only Python_ 2.4 or greater and the cElementTree_ |
961 | +package (included in Python 2.5 and later) to run. If you would *optionally* |
962 | +like to be able to access branches using SFTP, you need `paramiko and |
963 | +pycrypto`_. |
964 | + |
965 | +.. _Python: http://www.python.org/ |
966 | +.. _cElementTree: http://effbot.org/zone/element-index.htm |
967 | +.. _paramiko and pycrypto: http://www.lag.net/paramiko/ |
968 | + |
969 | +For maximum performance, Bazaar can make use of compiled versions of some |
970 | +critical components of the code. Pure Python alternatives exist for all of |
971 | +these components, but they may be considerably slower. To compile these |
972 | +extensions, you need a C compiler and the relevant header files from the |
973 | +Python package. On Linux, these may be in a separate package. Other |
974 | +operating systems should have the required headers installed by default. |
975 | + |
976 | +If you are installing a development version of Bazaar, rather than a released |
977 | +version, you will need Pyrex_ to create the C extensions. The release |
978 | +tarballs already have the Pyrex-created C files. |
979 | + |
980 | +.. _Pyrex: http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/ |
981 | + |
982 | + |
983 | + |
984 | |
985 | === added file 'doc/en/admin-guide/migration.txt' |
986 | --- doc/en/admin-guide/migration.txt 1970-01-01 00:00:00 +0000 |
987 | +++ doc/en/admin-guide/migration.txt 2009-12-07 03:05:25 +0000 |
988 | @@ -0,0 +1,68 @@ |
989 | +Migration |
990 | +========= |
991 | + |
992 | +Fast Import |
993 | +----------- |
994 | + |
995 | +In many projects wishing to use Bazaar, there is pre-existing history for the |
996 | +codebase that should be taken into consideration. Bazaar leverages an |
997 | +interchange format originally developed for Git called `fast-import` to |
998 | +provide migration strategies for many other version control systems. To |
999 | +work with fast-import files, Bazaar needs the `fastimport`_ plugin. This can |
1000 | +be installed as with any Bazaar plugin. |
1001 | + |
1002 | +.. _fastimport: http://launchpad.net/bzr-fastimport |
1003 | + |
1004 | +The way that fast-import can be used for migration is to export the existing |
1005 | +history into a fast-import file, then use the ``bzr fast-import`` command. |
1006 | +The `fastimport` plugin includes exporters for Subversion, CVS, Git, Mercurial |
1007 | +and darcs, accessible as the ``fast-export-from-XXX`` commands. Note that |
1008 | +``fast-import`` should not be used in a branch with existing history. |
1009 | + |
1010 | +Assuming that ProjectX was first developed in Mercurial before switching to |
1011 | +Bazaar, and that the Mercurial repository is in ``/srv/hg/projectx``, the |
1012 | +following commands will import that history into a newly created ``trunk`` |
1013 | +branch. (Recall that in `Further Configuration |
1014 | +<simple-setups.html#further-configuration>`_ we created the |
1015 | +``/srv/bzr/projectx`` directory as a shared repository.) |
1016 | + |
1017 | +:: |
1018 | + |
1019 | + $ cd /srv/bzr/projectx |
1020 | + $ bzr fast-export-from-hg ../../hg/projectx projectx.fi |
1021 | + $ bzr init trunk |
1022 | + $ bzr fast-import projectx.fi trunk |
1023 | + |
1024 | +Subversion Conversion |
1025 | +--------------------- |
1026 | + |
1027 | +As the most common centralized version control system, migration from |
1028 | +Subversion is particularly important for any *new* version control system. |
1029 | +Bazaar's `svn`_ plugin provides tools for interaction with Subversion |
1030 | +projects. In fact, Bazaar can be used transparently with projects stored in |
1031 | +Subversion, but that is beyond the scope of this document. (See |
1032 | +http://doc.bazaar-vcs.org/en/migration/foreign/bzr-on-svn-projects.html for |
1033 | +more on that subject.) What is relevant here is the ``svn-import`` command |
1034 | +provided by that plugin. This can import an entire subversion repository |
1035 | +including tags and branches, particularly if they are stored in Subversion's |
1036 | +recommended directory structure: ``/tags/``, ``/branches/`` and ``/trunk/``. |
1037 | + |
1038 | +This command has flexible ways to specify what paths within the Subversion |
1039 | +repository contain branches and which contain tags. For example, the |
1040 | +recommended layout for Subversion projects (called ``trunk`` by the svn |
1041 | +plugin) could be specified in ``~/.bazaar/subversion.conf`` as |
1042 | + |
1043 | +:: |
1044 | + |
1045 | + [203ae883-c723-44c9-aabd-cb56e4f81c9a] |
1046 | + branches = branches/* |
1047 | + tags = tags/* |
1048 | + |
1049 | +This allows substantially complicated Subversion repositories to be converted |
1050 | +into a set of separate Bazaar branches. After installing the svn plugin, see |
1051 | +``bzr help svn-import`` and ``bzr help svn-layout``. |
1052 | + |
1053 | +.. _svn: http://launchpad.net/bzr-svn |
1054 | + |
1055 | +.. TODO: Legacy VCS to bzr sync. Tailor? Incremental conversions? |
1056 | + |
1057 | |
1058 | === added file 'doc/en/admin-guide/other-setups.txt' |
1059 | --- doc/en/admin-guide/other-setups.txt 1970-01-01 00:00:00 +0000 |
1060 | +++ doc/en/admin-guide/other-setups.txt 2009-12-07 03:05:25 +0000 |
1061 | @@ -0,0 +1,60 @@ |
1062 | +Other Setups |
1063 | +============ |
1064 | + |
1065 | +Dumb servers |
1066 | +------------ |
1067 | + |
1068 | +Bazaar can also serve branches over protocols that know nothing about Bazaar's |
1069 | +specific needs. These are called "dumb servers" to distinguish them from |
1070 | +Bazaar's native protocol. Currently HTTP, FTP, SFTP and HTTP+WebDAV can be |
1071 | +used to read branches remotely. FTP, SFTP and HTTP+WebDAV can be used for |
1072 | +writing as well. To use any of these protocols, it is just necessary to |
1073 | +provide access to the server's filesystem under ``/srv/bzr``. |
1074 | + |
1075 | +For example, for Apache to provide read-only access to the branches |
1076 | +in ``/srv/bzr`` the configuration may look like this:: |
1077 | + |
1078 | + Alias /code /srv/bzr |
1079 | + <Directory /srv/bzr> |
1080 | + Options Indexes |
1081 | + # ... |
1082 | + </Directory> |
1083 | + |
1084 | +and users could use the URL ``http://server.example.com/code/projectx/trunk`` |
1085 | +to refer to the trunk branch. |
1086 | + |
1087 | +Note that SFTP access is often available whenever there is SSH access, but it |
1088 | +may be a good choice when Bazaar cannot be installed on the server to allow |
1089 | +``bzr+ssh://`` access. Dumb servers are slower by their very nature than the |
1090 | +native protocol, but they can be a good choice in situations where the |
1091 | +software and protocols that can be used on the server or the network is |
1092 | +limited. |
1093 | + |
1094 | +Smart server over HTTP(S) |
1095 | +------------------------- |
1096 | + |
1097 | +Bazaar can use its native protocol with HTTP requests. Since HTTP is a |
1098 | +network protocol that is available on many networks, this can be a good option |
1099 | +where SSH access is not possible. Another benefit of this setup is that all |
1100 | +of the authentication and access control methods available to the HTTP server |
1101 | +(basic, LDAP, ActiveDirectory, etc.) are then available to control access to |
1102 | +Bazaar branches. More information about setting up this type of access using |
1103 | +Apache and FastCGI or mod_python or WSGI is in the |
1104 | +`User's Guide <../user-guide/http_smart_server.html>`_. |
1105 | + |
1106 | +Direct Smart Server Access |
1107 | +-------------------------- |
1108 | + |
1109 | +The built-in server that is used by ``bzr+ssh://`` access can also be used as |
1110 | +a persistent server on a dedicated port. Bazaar's official port is 4155, |
1111 | +although the port used can be configured. Further information on running the |
1112 | +Bazaar smart server from inetd, or directly from the shell is in the `User's |
1113 | +Guide <../user-guide/server.html#inetd>`_. The dedicated Bazaar server does not |
1114 | +currently perform any authentication, so this server by default provides |
1115 | +read-only access. It can be run with the ``--allow-writes`` option, but if |
1116 | +the user that the server is running as has write access to the branch |
1117 | +directories on the filesystem, then this will allow anyone with access to port |
1118 | +4155 on the server to make changes to the branches stored there. |
1119 | + |
1120 | + |
1121 | + |
1122 | |
1123 | === added file 'doc/en/admin-guide/security.txt' |
1124 | --- doc/en/admin-guide/security.txt 1970-01-01 00:00:00 +0000 |
1125 | +++ doc/en/admin-guide/security.txt 2009-12-07 03:05:25 +0000 |
1126 | @@ -0,0 +1,9 @@ |
1127 | +Security |
1128 | +======== |
1129 | + |
1130 | +Authentication |
1131 | +-------------- |
1132 | + |
1133 | +Access Control |
1134 | +-------------- |
1135 | + |
1136 | |
1137 | === added file 'doc/en/admin-guide/simple-setups.txt' |
1138 | --- doc/en/admin-guide/simple-setups.txt 1970-01-01 00:00:00 +0000 |
1139 | +++ doc/en/admin-guide/simple-setups.txt 2009-12-07 03:05:25 +0000 |
1140 | @@ -0,0 +1,92 @@ |
1141 | +Simple Setups |
1142 | +============= |
1143 | + |
1144 | +Consider the following simple scenario where we will be serving Bazaar |
1145 | +branches that live on a single server. Those branches are in the |
1146 | +subdirectories of ``/srv/bzr`` (or ``C:\\bzr``) and they will all be related to a |
1147 | +single project called "ProjectX". ProjectX will have a trunk branch and at |
1148 | +least one feature branch. As we get further, we will consider other |
1149 | +scenarios, but this will be a sufficiently motivating example. |
1150 | + |
1151 | +Smart server |
1152 | +------------ |
1153 | + |
1154 | +The simplest possible setup for providing outside access to the branches on |
1155 | +the server uses Bazaar's built-in smart server tunneled over SSH_ so |
1156 | +that people who can access your server using SSH can have read and write |
1157 | +access to branches on the server. This setup uses the authentication |
1158 | +mechanisms of SSH including private keys, and the access control mechanisms of |
1159 | +the server's operating system. In particular, using groups on the server, it |
1160 | +is possible to provide different access privileges to different groups of |
1161 | +developers. |
1162 | + |
1163 | +.. _SSH: http://www.openssh.org/ |
1164 | + |
1165 | +Setup |
1166 | +~~~~~ |
1167 | + |
1168 | +There is no setup required for this on the server, apart from having Bazaar |
1169 | +installed and SSH access available to your developers. Using SSH |
1170 | +configuration options it is possible to restrict developers from using |
1171 | +anything *but* Bazaar on the server via SSH, and to limit what part of the |
1172 | +file system they can access. |
1173 | + |
1174 | +Client |
1175 | +~~~~~~ |
1176 | + |
1177 | +Clients can access the branches using URLs with the ``bzr+ssh://`` prefix. For |
1178 | +example, to get a local copy of the ProjectX trunk, a developer could do:: |
1179 | + |
1180 | + $ bzr branch bzr+ssh://server.example.com/srv/bzr/projectx/trunk projectx |
1181 | + |
1182 | +If the developers have write access to the ``/srv/bzr/projectx`` directory, then |
1183 | +they can create new branches themselves using:: |
1184 | + |
1185 | + $ bzr branch bzr+ssh://server.example.com/srv/bzr/projectx/trunk \ |
1186 | + bzr+ssh://server.example.com/srv/bzr/projectx/feature-gui |
1187 | + |
1188 | +Of course, if this isn't desired, then developers should not have write access |
1189 | +to the ``/srv/bzr/projectx`` directory. |
1190 | + |
1191 | +Further Configuration |
1192 | +~~~~~~~~~~~~~~~~~~~~~ |
1193 | + |
1194 | +For a project with multiple branches that are all related, it is best to use a |
1195 | +shared repository to hold all of the branches. To set this up, do:: |
1196 | + |
1197 | + $ cd /srv/bzr |
1198 | + $ bzr init-repo --no-trees projectx |
1199 | + |
1200 | +The ``--no-trees`` option saves space by not creating a copy of the working |
1201 | +files on the server's filesystem. Then, any branch created under |
1202 | +``/srv/bzr/projectx`` (see `Migration <migration.html>`_ for some ways to do |
1203 | +this) will share storage space, which is particularly helpful for branches that |
1204 | +have many revisions in common, such as a project trunk and its feature |
1205 | +branches. |
1206 | + |
1207 | +If Bazaar is not installed on the user's path or not specified in the SSH |
1208 | +configuration, then a path can be specified from the client with the |
1209 | +``BZR_REMOTE_PATH`` environment variable. For example, if the Bazaar executable |
1210 | +is installed in ``/usr/local/bzr-2.0/bin/bzr``, then a developer could use:: |
1211 | + |
1212 | + $ BZR_REMOTE_PATH=/usr/local/bzr-2.0/bin/bzr bzr info \ |
1213 | + bzr+ssh://server.example.com/srv/bzr/proectx/trunk |
1214 | + |
1215 | +to get information about the trunk branch. The remote path can also be |
1216 | +specified in Bazaar's configuration files for a particular location. See |
1217 | +``bzr help configuration`` for more details. |
1218 | + |
1219 | +If developers have home directories on the server, they can use ``/~/`` in |
1220 | +URLs to refer to their home directory. They can also use ``/~username/`` to |
1221 | +refer to the home directory of user ``username``. For example, if there are two |
1222 | +developers ``alice`` and ``bob``, then Bob could use:: |
1223 | + |
1224 | + $ bzr log bzr+ssh://server.example.com/~/fix-1023 |
1225 | + |
1226 | +to refer to one of his bug fix branches and:: |
1227 | + |
1228 | + $ bzr log bzr+ssh://server.example.com/~alice/fix-2047 |
1229 | + |
1230 | +to refer to one of Alice's branches. |
1231 | + |
1232 | + |
1233 | |
1234 | === added file 'doc/en/admin-guide/upgrade.txt' |
1235 | --- doc/en/admin-guide/upgrade.txt 1970-01-01 00:00:00 +0000 |
1236 | +++ doc/en/admin-guide/upgrade.txt 2009-12-07 03:05:25 +0000 |
1237 | @@ -0,0 +1,76 @@ |
1238 | +Upgrades |
1239 | +======== |
1240 | + |
1241 | +Bazaar has a strong commitment to inter-version compatibility both on disk and |
1242 | +over the network. Newer clients should be able to interact with older |
1243 | +versions on the server (although perhaps not at optimal speed) and older |
1244 | +clients should also be able to communicate with newer versions of Bazaar on |
1245 | +the server. Divergences from this rule are considered bugs and are fixed in |
1246 | +later versions. |
1247 | + |
1248 | +That said, Bazaar is constantly improving and the most recent versions are the |
1249 | +most featureful and have better performance. In particular, the Bazaar |
1250 | +versions after 2.0 have significant advantages over earlier versions, |
1251 | +including a more compact disk format, faster network operations and overall |
1252 | +performance improvements. With the 2.0 release, Bazaar has moved to a |
1253 | +stable/development release model where the 2.x series is maintained with |
1254 | +bugfixes releases for six months, while simultaneously the 2.(x+1) series is |
1255 | +being developed with monthly beta releases that are suitable for everyday use. |
1256 | +Bazaar development has a stable trunk with an extensive test suite, so there |
1257 | +is no reason to fear using the development series for everyday use, it simply |
1258 | +changes more often than the stable series. |
1259 | + |
1260 | + |
1261 | +Software upgrades |
1262 | +----------------- |
1263 | + |
1264 | +Upgrading the Bazaar software is as simple re-installing the Python package |
1265 | +using either the latest binary package for Windows or Mac OS X, the binary |
1266 | +package provided by your Linux distribution, or installing from the source |
1267 | +release. See http://bazaar-vcs.org/Downloads for the latest releases for all |
1268 | +supported platforms. |
1269 | + |
1270 | +Bazaar's later versions support all of the earlier disk formats (back to the |
1271 | +very first one), so there is no need to upgrade the branches on the disk when |
1272 | +upgrading the software. To make use of particular new features that might |
1273 | +need updated versions on both the server and developer's machines, it does not |
1274 | +matter if the clients or the servers are upgraded first. |
1275 | + |
1276 | + |
1277 | +Disk format upgrades |
1278 | +-------------------- |
1279 | + |
1280 | +In its evolution, Bazaar has used a sequence of disk formats for improved |
1281 | +storage efficiency and speed. With the new disk format released in version |
1282 | +2.0, there is a commitment to keep that disk format until version 3.0 is |
1283 | +released, which has not even been planned yet. (Bazaar 2.0 was released |
1284 | +almost two years after Bazaar 1.0.) As a result, disk format upgrades should |
1285 | +be extremely infrequent. |
1286 | + |
1287 | +If there are existing branches in an older format that you would like to |
1288 | +upgrade to the latest format, you can see the `2.0 Upgrade Guide |
1289 | +<../upgrade-guide/index.html>`_ for more information. From the system |
1290 | +administration perspective, it is important to coordinate the timing of |
1291 | +various upgrades in the process. First, the central branches on the server |
1292 | +should be upgraded. Next, any local mirrors that developers have should be |
1293 | +upgraded. Finally, developers' local branches should be upgraded. These |
1294 | +upgrades will require an appropriate version of the software whenever they are |
1295 | +performed. (It is possible to upgrade branches remotely over the network, but |
1296 | +it may be much slower.) |
1297 | + |
1298 | + |
1299 | +Plugin upgrades |
1300 | +--------------- |
1301 | + |
1302 | +When Bazaar does update its version, plugins that use the Bazaar API may need |
1303 | +to be upgraded to reflect changes in that API. Some plugins have strict |
1304 | +version dependencies on the version of the Bazaar API that they will accept. |
1305 | +If this is the case, then you should ensure that the plugins you depend on |
1306 | +have been updated *before* you upgrade your Bazaar version to avoid a |
1307 | +situation where your plugins won't work with the installed version of Bazaar. |
1308 | +If this does happen, then the solution is simply to reinstall the previous |
1309 | +version of Bazaar that *did* work with the plugins. For installations that |
1310 | +depend on a large number of plugins, this sort of version upgrade should be |
1311 | +tested in a safe sandbox to ensure that the entire collection of Bazaar and |
1312 | +its plugins can all work together. |
1313 | + |
1314 | |
1315 | === modified file 'doc/en/conf.py' |
1316 | --- doc/en/conf.py 2009-09-09 13:34:08 +0000 |
1317 | +++ doc/en/conf.py 2009-12-07 03:05:25 +0000 |
1318 | @@ -73,8 +73,6 @@ |
1319 | |
1320 | # List of documents that shouldn't be included in the build. |
1321 | unused_docs = [ |
1322 | - # Placeholder for later |
1323 | - 'admin-guide/index', |
1324 | # Subtopics that get included |
1325 | 'upgrade-guide/overview', |
1326 | 'upgrade-guide/data_migration', |
1327 | |
1328 | === modified file 'doc/en/index.txt' |
1329 | --- doc/en/index.txt 2009-09-09 11:43:10 +0000 |
1330 | +++ doc/en/index.txt 2009-12-07 03:05:25 +0000 |
1331 | @@ -16,3 +16,4 @@ |
1332 | release-notes/index |
1333 | upgrade-guide/index |
1334 | user-reference/index |
1335 | + admin-guide/index |
This adds content to the System Administrator's Guide, while also structuring that content as separate files for each "chapter". There is great room for improvement in many of these topics, particularly the ones that are completely empty (integration.txt, security.txt), but I think it's worth merging this and then doing further changes to improve it. The only exception would be egregious errors which should be corrected before merging any version of it.
I understand it's a lot of text and hopefully we can get some kind of meaningful reviews in order to get it merged.