7
BzrTools is a collection of useful enhancements to Bazaar.
8
Here is a sample of the frequently used commands it provides.
11
shelve, shelf, unshelve
12
-----------------------
14
These commands provide a fine-grained (patch-hunk level) undo facility.
15
This allows you to put aside some of your changes, commit,
16
and get back to where you were before.
18
For example, consider a working tree with one or more changes made ... ::
21
=== modified file 'description.txt'
29
+written by Michael Ellerman
38
+perform a commit, and get
42
The ``shelve`` command interactively asks which changes
43
you want to retain in the working tree::
53
+written by Michael Ellerman
58
Keep this change? (1 of 2) [nydisq?] (n): y
66
+perform a commit, and get
70
Keep this change? (2 of 2) [nydisq?] (n): n
77
Shelve these changes, or restart? [yrsiq?] (y): y
78
Saving shelved patches to /tmp/proj/.bzr-shelf
79
Reverting shelved patches
81
description.txt | 2 +-
82
1 files changes, 1 insertions(+), 1 deletions(-)
84
If there are lots of changes in the working tree, you
85
can provide the ``shelve`` command with a list of files
86
and you will only be asked about changes in those files.
87
After shelving changes, it's a good idea to use ``diff``
88
to confirm the tree has just the changes you expect::
91
=== modified file 'description.txt'
99
+written by Michael Ellerman
104
Great - you're ready to commit::
106
$ bzr commit -m "improve first sentence"
108
At some later time, you can bring the shelved changes back into the
109
working tree using ``unshelve``::
112
Reapplying shelved patches
114
description.txt | 4 ++--
115
1 files changes, 2 insertions(+), 2 deletions(-)
117
If you want to, you can put multiple items on the shelf.
118
Normally each time you run ``unshelve`` the most recently
119
shelved changes will be reinstated. However, you can also
120
unshelve changes in a different order by explicitly
121
specifying which changes to unshelve. (This works best
122
when the changes don't depend on each other.)
124
While you have patches on the shelf you can view and manipulate them
125
with the ``shelf`` command. Run ``bzr shelf -h`` for more information
126
about how to do this.
132
``bzr shell`` starts up a command interpreter than understands
133
Bazaar commands natively. This has several advantages:
135
* There's no need to type ``bzr`` at the front of every command.
137
* Intelligent auto-completion is provided.
139
* Commands run slightly faster as there's no need to load Bazaar's
146
``bzr cdiff`` provides a colored version of ``bzr diff`` output.
147
On GNU/Linux, UNIX and OS X, this is often used like this::