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
|
BzrTools
========
Overview
--------
BzrTools is a collection of useful enhancements to Bazaar.
For installation instructions, see the BzrTools home page:
http://bazaar-vcs.org/BzrTools.
Here is a sample of the frequently used commands it provides.
shelve, shelf, unshelve
-----------------------
These commands provide a fine-grained (patch-hunk level) undo facility.
This allows you to put aside some of your changes, commit,
and get back to where you were before.
For example, consider a working tree with one or more changes made ... ::
$ bzr diff
=== modified file 'description.txt'
--- description.txt
+++ description.txt
@@ -2,7 +2,7 @@
===============
These plugins
-by Michael Ellerman
+written by Michael Ellerman
provide a very
fine-grained 'undo'
facility
@@ -11,6 +11,6 @@
This allows you to
undo some of
your changes,
-commit, and get
+perform a commit, and get
back to where you
were before.
The ``shelve`` command interactively asks which changes
you want to retain in the working tree::
$ bzr shelve
--- description.txt
+++ description.txt
@@ -2,7 +2,7 @@
===============
These plugins
-by Michael Ellerman
+written by Michael Ellerman
provide a very
fine-grained 'undo'
facility
Keep this change? (1 of 2) [nydisq?] (n): y
--- description.txt
+++ description.txt
@@ -11,6 +11,6 @@
This allows you to
undo some of
your changes,
-commit, and get
+perform a commit, and get
back to where you
were before.
Keep this change? (2 of 2) [nydisq?] (n): n
Status:
description.txt
1 hunks to be shelved
1 hunks to be kept
Shelve these changes, or restart? [yrsiq?] (y): y
Saving shelved patches to /tmp/proj/.bzr-shelf
Reverting shelved patches
Diff status is now:
description.txt | 2 +-
1 files changes, 1 insertions(+), 1 deletions(-)
If there are lots of changes in the working tree, you
can provide the ``shelve`` command with a list of files
and you will only be asked about changes in those files.
After shelving changes, it's a good idea to use ``diff``
to confirm the tree has just the changes you expect::
$ bzr diff
=== modified file 'description.txt'
--- description.txt
+++ description.txt
@@ -2,7 +2,7 @@
===============
These plugins
-by Michael Ellerman
+written by Michael Ellerman
provide a very
fine-grained 'undo'
facility
Great - you're ready to commit::
$ bzr commit -m "improve first sentence"
At some later time, you can bring the shelved changes back into the
working tree using ``unshelve``::
$ bzr unshelve
Reapplying shelved patches
Diff status is now:
description.txt | 4 ++--
1 files changes, 2 insertions(+), 2 deletions(-)
If you want to, you can put multiple items on the shelf.
Normally each time you run ``unshelve`` the most recently
shelved changes will be reinstated. However, you can also
unshelve changes in a different order by explicitly
specifying which changes to unshelve. (This works best
when the changes don't depend on each other.)
While you have patches on the shelf you can view and manipulate them
with the ``shelf`` command. Run ``bzr shelf -h`` for more information
about how to do this.
shell
-----
``bzr shell`` starts up a command interpreter than understands
Bazaar commands natively. This has several advantages:
* There's no need to type ``bzr`` at the front of every command.
* Intelligent auto-completion is provided.
* Commands run slightly faster as there's no need to load Bazaar's
libraries each time.
cdiff
-----
``bzr cdiff`` provides a colored version of ``bzr diff`` output.
On GNU/Linux, UNIX and OS X, this is often used like this::
bzr cdiff | less -R
|