/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/short-demo.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
******************************
 
2
Learn Bazaar in twenty minutes
 
3
******************************
 
4
 
 
5
 
 
6
:Author:
 
7
  Martin Pool <mbp@sourcefrog.net>
 
8
 
 
9
:Date: November 2004, London
 
10
 
 
11
 
 
12
*Bazaar* is an open source distributed version control system.  A
 
13
version control system helps you develop software (or other documents)
 
14
 
 
15
In Bazaar, branches hold a history of their changes.  All working
 
16
copies are branches, and all branches are working copies.
 
17
 
 
18
Let's get a copy of someone else's published project::
 
19
 
 
20
    $ baz branch http://baz.alice.org/hello-2.6
 
21
 
 
22
This creates a directory called ``hello-2.6`` in your current
 
23
directory, containing Alice's *Hello World* 2.6 tree and a history of
 
24
her changes.  We'll leave this directory containing a pristine copy of
 
25
her work for future reference.
 
26
 
 
27
We want to add a new feature.  Branching and merging is are cheap and
 
28
easy in Baz, so development of each new feature should be done on a
 
29
new branch -- this lets you merge them in different orders, and leave
 
30
aside new development to fix a bug if you want.  It's good to choose a
 
31
meaningful name for your development branches so that you can keep
 
32
them straight.  So let's make an additional branch, based off our
 
33
local copy of Alice's branch::
 
34
 
 
35
    $ baz branch ./hello-2.6 ./hello-2.6-goodbye
 
36
 
 
37
This command completed quickly: we didn't need to fetch anything from
 
38
Alice's server to make a new branch.
 
39
 
 
40
Now we have a second directory containing another copy of the source,
 
41
with a different name.  Of course both are still the same as Alice's
 
42
source.  Time to hack::
 
43
 
 
44
    $ cd hello-2.6-goodbye
 
45
    $ vi hello.c
 
46
 
 
47
We add a new and much-desired ``--goodbye`` option, build and test
 
48
it.  Having got to a good state, we think we're ready to commit our
 
49
changes.  Many people find it helpful to review the changes before
 
50
committing them, just to make sure there were no accidental mistakes::
 
51
 
 
52
    $ baz diff | less
 
53
 
 
54
This shows the changes relative to the version we started with.  If
 
55
that looks OK, we're ready to commit::
 
56
 
 
57
    $ baz commit -m 'Add --goodbye option'
 
58
 
 
59
This records the changes into this branch.  We can see that they got
 
60
recorded::
 
61
 
 
62
    $ baz log | less
 
63
 
 
64
This will show our change as the most recent, preceded by all our
 
65
development.  If we only want to see our own changes, we can filter
 
66
the log in various ways::
 
67
 
 
68
    $ baz log --author bruce@ 
 
69
    $ baz log --date today 
 
70
 
 
71
(That second one might include anything Alice did before we started.)
 
72
 
 
73
Since our changes were committed, we don't have anything outstanding,
 
74
as we can see with this command::
 
75
 
 
76
    $ baz diff 
 
77
    No changes
 
78
 
 
79
Thinking about it a bit more, we decide that it's too messy to mix the
 
80
"Goodbye" implementation in with "Hello world".  We start up our
 
81
editor and split it our into a new separate file, ``bye.c``.  By
 
82
default, Baz assumes unknown files in the working directory are
 
83
scratch files -- the same behaviour as CVS and Subversion.  We need to
 
84
tell Baz that this file should be versioned, and then we can commit::
 
85
 
 
86
    $ baz add bye.c
 
87
    $ baz commit -s 'Refactor bye() into separate file'
 
88
 
 
89
Of course this commits all our changes as a single atomic
 
90
transaction.  If we wanted, we could tell Baz to build the program
 
91
before committing to help ensure we never get a broken build.
 
92
 
 
93
We're ready to publish our improved Hello World, but first we want to
 
94
make sure we've integrated anything Alice has done while we were
 
95
working.  First we update our mirror of Alice's branch::
 
96
 
 
97
    $ baz sync ../hello-2.6
 
98
 
 
99
This pulls the history of her branch onto our machine; we could
 
100
disconnect from the network at this point and do all the merging work
 
101
without needing to connect to ``alice.org``.   
 
102
 
 
103
Now we'll pull Alice's new changes into our branch.  We can use a
 
104
mirror of her branch, or we can go straight to her public branch.  In
 
105
fact, we can merge from different copies of the same branch at
 
106
different times, and Baz will still understand which changesets have
 
107
already been merged.  Either of these commands will work::
 
108
 
 
109
    $ baz merge ../hello-2.6
 
110
    $ baz merge http://baz.alice.org/hello-2.6
 
111
 
 
112
This pulls down any changesets on Alice's branch that aren't in ours,
 
113
and applies them to our tree.  Since we've made changes in parallel
 
114
with Alice, those changes might conflict.  Baz by default will insert
 
115
CVS-style conflict markers into your branch if that happens, but you
 
116
can also ask it to run a graphical merge tool or to tell emacs to do
 
117
the merge.  Baz will help you merge changes other than file text, such
 
118
as a file being renamed in one branch.  
 
119
 
 
120
By running ``baz diff`` we can see the effect of her changes on our
 
121
tree.  By running ``baz log --pending`` we can see a description of
 
122
all of the changes that were pulled in.  Once the changes have been
 
123
reconciled (which will often happen automatically), we can commit this
 
124
to our branch::
 
125
 
 
126
    $ baz commit -s 'Merge from Alice'
 
127
 
 
128
Baz records that our change incorporates those patches from Alice::
 
129
 
 
130
    $ baz log | less
 
131
 
 
132
Now that we have the feature we wanted, we can publish our branch on
 
133
the web.  We could copy it up using ``baz branch``, but because Baz
 
134
branches are simply directories we can just rsync it onto a web
 
135
server, even if the web server doesn't have Baz installed::
 
136
 
 
137
    $ rsync -av ./hello-2.6-goodbye webserver.com:public_html/
 
138
 
 
139
We send an email to Alice asking her to merge from this location.
 
140
Typically she'll want to have a look at those changes before accepting
 
141
them, and she can do that by running ``merge`` then ``diff``, as we
 
142
did before.  If she likes the change, she can merge it, possibly
 
143
applying some fixes in the process.  Next time we merge from her,
 
144
we'll see our changes are in.
 
145
 
 
146
 
 
147
 
 
148
.. Local variables:
 
149
.. mode: rst
 
150
.. compile-command: "rest2html short-demo.txt > short-demo.html"
 
151
.. End:
 
152