/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
2977.1.2 by Ian Clatworthy
add conflict handling as an Appendix + minor tweaks
1
Workflows
2
=========
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
3
4
Bazaar is just a tool
5
---------------------
6
7
One of the best things about Bazaar is that it supports many
8
different ways of working together. This means that you can
9
start with one workflow and adapt it over time as circumstances
10
change. There is no "one true way" that always makes sense and
2977.1.17 by Ian Clatworthy
more chapter 1 tweaks
11
there never will be. This section provides a brief overview of
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
12
some popular workflows supported by Bazaar.
13
14
15
Solo
16
----
17
18
Whether developing software, editing documents or changing configuration files, having an easy-to-use VCS tool can help. A single user can use this workflow effectively for managing projects where they are the only contributor.
19
20
.. image:: images/workflows_single.png
21
2977.1.17 by Ian Clatworthy
more chapter 1 tweaks
22
Advantages of this workflow over not using version control at all include:
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
23
24
 * backup of old versions
25
 * rollback to an earlier state
26
 * tracking of history.
27
28
The key features of Bazaar appropriate for this workflow are low administration (no server setup) and ease of use.
29
30
31
Partner
32
-------
33
2977.1.17 by Ian Clatworthy
more chapter 1 tweaks
34
Sometimes two people need to work together sharing changes as they go. This commonly starts off as a *Solo* workflow (see above) or a team-oriented workflow (see below). At some point, the second person takes a branch (copy including history) of what the first person has done. They can then work in parallel exchanging changes by merging when appropriate.
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
35
36
.. image:: images/workflows_peer.png
37
38
Advantages over *Solo* are:
39
40
 * easier sharing of changes
41
 * each line of each text file can be attributed to a particular change including who changed it, when and why.
42
43
When implementing this workflow, Bazaar's advantages over CVS and Subversion include:
44
45
 * no server to setup
46
 * intelligent merging means merging multiple times isn't painful.
47
48
49
Centralized
50
-----------
51
2977.1.17 by Ian Clatworthy
more chapter 1 tweaks
52
Also known as *lock-step*, this is essentially the same as the workflow encouraged/enforced by CVS and Subversion. All developers work on the same branch (or branches). They run ``bzr update`` to get their checkout up-to-date, then ``bzr commit`` to publish their changes to the central location.
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
53
54
.. image:: images/workflows_centralized.png
55
56
Subversion and CVS are good choices for implementing this workflow because they make it easy. Unlike the vast majority of distributed VCS tools, Bazaar makes it easy as well by directly supporting it. In addition, Bazaar provides some important advantages over CVS and Subversion:
57
2977.1.17 by Ian Clatworthy
more chapter 1 tweaks
58
 * better branching and merging
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
59
 * better renaming support.
60
61
62
Centralized with local commits
63
------------------------------
64
2977.1.17 by Ian Clatworthy
more chapter 1 tweaks
65
This is essentially the same as the *Centralized* model, except that when developers are making a series of changes, they do ``commit --local`` or unbind their checkout. When it is complete, they commit their work to the shared mainline.
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
66
67
.. image:: images/workflows_localcommit.png
68
69
Advantages over *Centralized*:
70
71
 * Can work offline, e.g. when disconnected during travel
72
 * Less chance for a bad commit to interfere with everyone else's work
73
74
Subversion and CVS do not support this model. Other distributed VCS tools can support it but do so less directly than Bazaar does.
75
76
77
Decentralized with shared mainline
78
----------------------------------
79
80
In this workflow, each developer has their own branch or branches, plus commit rights to the main branch. They do their work in their personal branch, then merge it into the mainline when it is ready.
81
82
.. image:: images/workflows_shared.png
83
84
Advantage over *Centralized with local commits*:
85
86
 * Easier organization of work - separate changes can be developed in their own branches
2977.1.17 by Ian Clatworthy
more chapter 1 tweaks
87
 * Developers can merge one another's personal branches when working on something together.
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
88
2977.1.17 by Ian Clatworthy
more chapter 1 tweaks
89
Subversion and CVS do not support this model. Other distributed VCS
90
tools support it. Many features of Bazaar are good for this workflow
91
including ease of use, shared repositories, integrated merging and
92
rich metadata (including directory rename tracking).
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
93
94
95
Decentralized with human gatekeeper
96
-----------------------------------
97
98
In this workflow, each developer has their own branch or branches, plus read-only access to the main branch. One developer (the gatekeeper) has commit rights to the main branch. When a developer wants their work merged, they ask the gatekeeper to merge it. The gatekeeper does code review, and merges the work into the main branch if it meets the necessary standards.
99
100
.. image:: images/workflows_gatekeeper.png
101
102
Advantage over *Decentralized with shared mainline*:
103
2977.1.17 by Ian Clatworthy
more chapter 1 tweaks
104
 * Code is always reviewed before it enters the mainline
105
 * Tighter control over when changes get incorporated into the mainline.
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
106
2977.1.17 by Ian Clatworthy
more chapter 1 tweaks
107
A companion tool of Bazaar's called Bundle Buggy can be very useful for tracking what changes are up for review, their status and reviewer comments.
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
108
109
110
Decentralized with automatic gatekeeper
111
---------------------------------------
112
2977.1.17 by Ian Clatworthy
more chapter 1 tweaks
113
In this workflow, each developer has their own branch or branches, plus read-only access to the mainline. A software gatekeeper (e.g. PQM) has commit rights to the main branch. When a developer wants their work merged, they request another person to review it. Once passed review, either the original author or the reviewer asks the gatekeeper to merge it, depending on team policies. The gatekeeper does a merge, a compile, and runs the test suite. If and only if the code passes, it is merged into the mainline.
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
114
115
Note: As an alternative, the review step can be skipped and the author can submit the change to the automatic gatekeeper without it. (This is particularly appropriate when using practices such as Pair Programming that effectively promote just-in-time reviews instead of reviewing code as a separate step.)
116
117
.. image:: images/workflows_pqm.png
118
119
Advantages over *Decentralized with human gatekeeper*:
120
121
 * Code is always tested before it enters the mainline (so the integrity of the mainline is higher)
122
 * Scales better as teams grow.
123
2977.1.17 by Ian Clatworthy
more chapter 1 tweaks
124
A companion tool of Bazaar's called Patch Queue Manager (PQM) can provide the automated gatekeeper capability.
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
125
126
127
Implementing a workflow
128
-----------------------
129
2977.1.17 by Ian Clatworthy
more chapter 1 tweaks
130
For an in-depth look at how to implement each of the workflows above,
131
see chapters 3 to 6 in this manual. First though, chapter 2
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
132
explains some important pre-requisites including installation, general
133
usage instructions and configuration tips.