1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
====================
Bazaar Mini Tutorial
====================
.. contents::
Introduction
============
This is a very brief 5-minute tutorial, covering only what a first time user
needs to start a project or start contributing to a project using Bazaar.
For a more detailed look, see `Learning More`_.
Installation
============
See http://bazaar-vcs.org/Download. Bazaar is probably in your GNU/Linux
distribution already. If not, it's trivial to install on any platform that
runs Python 2.4, including Windows. Installation should take at most a few
minutes.
Introducing Yourself
====================
You want Bazaar to correctly identify you in revision logs. Using your name
and email instead of Joe Doe's, type::
$ bzr whoami "Joe Doe <joe.doe@gmail.com>"
Now try::
$ bzr whoami
Joe Doe <joe.doe@gmail.com>
Putting Existing Files Under Version Control
============================================
It is very easy to put an existing set of files under version control using
Bazaar::
$ cd my-project
$ bzr init .
$ bzr add
$ bzr commit -m "Initial import"
You can now make changes, track them, publish your branch and so on as
explained below.
Creating A Personal Branch
==========================
Rather than starting a new project, you may wish to work on an existing
project either you or someone else has published.
Create a branch of an existing project::
$ bzr branch http://example.com/code/foobar.dev foobar.joe
Branched 1 revision(s).
Note that after you create a personal branch, you don't need web access to
commit changes.
Making Changes
==============
Edit a file::
$ cd foobar.joe
$ hack...
Check what have you done::
$ bzr diff
=== modified file 'foo.c'
--- foo.c
+++ foo.c
@@ -30,6 +30,7 @@
#include "foo.h"
+
static PyObject *
_pyfribidi_log2vis (PyObject * self, PyObject * args, PyObject * kw)
{
Commit your hard work::
$ bzr commit -m 'added some whitespace'
Committed revision 2.
Viewing the Revision Log
========================
Browse the history of the branch::
$ bzr log
------------------------------------------------------------
revno: 2
committer: Joe Doe <joe.doe@gmail.com>
branch nick: foobar.joe
timestamp: Mon 2006-02-06 01:33:35 +0200
message:
added some whitespace
------------------------------------------------------------
revno: 1
committer: James Hacker <jmh@example.com>
branch nick: foobar.dev
timestamp: Mon 2006-02-06 01:06:11 +0200
message:
initial revision
Updating Your Branch from the Main Branch
=========================================
While you work hard on your branch, others may have committed new code to the
main branch. From time to time, you want to merge changes from the main
branch into your branch::
$ bzr merge
Using saved location: http://example.com/code/foobar.dev
All changes applied successfully.
What was changed locally by merging the main branch?
::
$ bzr diff
=== modified file 'pyfribidi.c'
--- pyfribidi.c
+++ pyfribidi.c
@@ -236,6 +236,7 @@
PyMem_Del (logical);
PyMem_Del (visual);
+ /* evil hack! */
return result;
}
Commit the changes from the main branch::
$ bzr commit -m 'merge from main branch'
Committed revision 6.
Note that you may occasionally need to resolve conflicts or make other minor
changes (so tests pass say) before committing. For these reasons, merge does
not implicitly commit.
Publishing Your Branch
======================
You can simply use rsync to copy your branch to a web server, but using
``bzr push`` is the easiest way. Let's assume you want to publish your
branch in jod.example.com/foobar.joe and you have sftp access to the server::
$ bzr push sftp://jod@jod.example.com/public_html/foobar.joe/
2 revision(s) pushed.
Note that to use sftp, your may need to install ''paramiko'' and ''pyCrypto''.
See http://bazaar-vcs.org/InstallationFaq for details.
Now anyone can get your branch with (try it yourself!)::
bzr branch http://jod.example.com/foobar.joe/
Learning More
=============
To learn about bzr topics::
$ bzr help
To learn about bzr commands::
$ bzr help commands
To learn about the ''foo'' topic or command::
$ bzr help foo
Alternatively, browse the `Bazaar Documentation <../../index.html>`_.
|