3416.1.1
by Ian Clatworthy
new structure and initial content for closing chapters |
1 |
BzrTools |
2 |
======== |
|
3 |
||
4 |
Overview |
|
5 |
-------- |
|
6 |
||
7 |
BzrTools is a collection of useful enhancements to Bazaar. |
|
3423.1.3
by Ian Clatworthy
incorporate feedback from Neil Martinsen-Burrell |
8 |
For installation instructions, see the BzrTools home page: |
9 |
http://bazaar-vcs.org/BzrTools. |
|
3416.1.1
by Ian Clatworthy
new structure and initial content for closing chapters |
10 |
Here is a sample of the frequently used commands it provides. |
11 |
||
12 |
||
13 |
shelve, shelf, unshelve |
|
14 |
----------------------- |
|
15 |
||
16 |
These commands provide a fine-grained (patch-hunk level) undo facility. |
|
17 |
This allows you to put aside some of your changes, commit, |
|
18 |
and get back to where you were before. |
|
19 |
||
20 |
For example, consider a working tree with one or more changes made ... :: |
|
21 |
||
22 |
$ bzr diff |
|
23 |
=== modified file 'description.txt' |
|
24 |
--- description.txt |
|
25 |
+++ description.txt |
|
26 |
@@ -2,7 +2,7 @@ |
|
27 |
=============== |
|
28 |
||
29 |
These plugins |
|
30 |
-by Michael Ellerman |
|
31 |
+written by Michael Ellerman |
|
32 |
provide a very |
|
33 |
fine-grained 'undo' |
|
34 |
facility |
|
35 |
@@ -11,6 +11,6 @@ |
|
36 |
This allows you to |
|
37 |
undo some of |
|
38 |
your changes, |
|
39 |
-commit, and get |
|
40 |
+perform a commit, and get |
|
41 |
back to where you |
|
42 |
were before. |
|
43 |
||
44 |
The ``shelve`` command interactively asks which changes |
|
45 |
you want to retain in the working tree:: |
|
46 |
||
47 |
$ bzr shelve |
|
48 |
--- description.txt |
|
49 |
+++ description.txt |
|
50 |
@@ -2,7 +2,7 @@ |
|
51 |
=============== |
|
52 |
||
53 |
These plugins |
|
54 |
-by Michael Ellerman |
|
55 |
+written by Michael Ellerman |
|
56 |
provide a very |
|
57 |
fine-grained 'undo' |
|
58 |
facility |
|
59 |
||
60 |
Keep this change? (1 of 2) [nydisq?] (n): y |
|
61 |
--- description.txt |
|
62 |
+++ description.txt |
|
63 |
@@ -11,6 +11,6 @@ |
|
64 |
This allows you to |
|
65 |
undo some of |
|
66 |
your changes, |
|
67 |
-commit, and get |
|
68 |
+perform a commit, and get |
|
69 |
back to where you |
|
70 |
were before. |
|
71 |
||
72 |
Keep this change? (2 of 2) [nydisq?] (n): n |
|
73 |
||
74 |
Status: |
|
75 |
description.txt |
|
76 |
1 hunks to be shelved |
|
77 |
1 hunks to be kept |
|
78 |
||
79 |
Shelve these changes, or restart? [yrsiq?] (y): y |
|
80 |
Saving shelved patches to /tmp/proj/.bzr-shelf |
|
81 |
Reverting shelved patches |
|
82 |
Diff status is now: |
|
83 |
description.txt | 2 +- |
|
84 |
1 files changes, 1 insertions(+), 1 deletions(-) |
|
85 |
||
86 |
If there are lots of changes in the working tree, you |
|
87 |
can provide the ``shelve`` command with a list of files |
|
88 |
and you will only be asked about changes in those files. |
|
89 |
After shelving changes, it's a good idea to use ``diff`` |
|
90 |
to confirm the tree has just the changes you expect:: |
|
91 |
||
92 |
$ bzr diff |
|
93 |
=== modified file 'description.txt' |
|
94 |
--- description.txt |
|
95 |
+++ description.txt |
|
96 |
@@ -2,7 +2,7 @@ |
|
97 |
=============== |
|
98 |
||
99 |
These plugins |
|
100 |
-by Michael Ellerman |
|
101 |
+written by Michael Ellerman |
|
102 |
provide a very |
|
103 |
fine-grained 'undo' |
|
104 |
facility |
|
105 |
||
106 |
Great - you're ready to commit:: |
|
107 |
||
108 |
$ bzr commit -m "improve first sentence" |
|
109 |
||
110 |
At some later time, you can bring the shelved changes back into the |
|
111 |
working tree using ``unshelve``:: |
|
112 |
||
113 |
$ bzr unshelve |
|
114 |
Reapplying shelved patches |
|
115 |
Diff status is now: |
|
116 |
description.txt | 4 ++-- |
|
117 |
1 files changes, 2 insertions(+), 2 deletions(-) |
|
118 |
||
119 |
If you want to, you can put multiple items on the shelf. |
|
120 |
Normally each time you run ``unshelve`` the most recently |
|
121 |
shelved changes will be reinstated. However, you can also |
|
122 |
unshelve changes in a different order by explicitly |
|
123 |
specifying which changes to unshelve. (This works best |
|
124 |
when the changes don't depend on each other.) |
|
125 |
||
126 |
While you have patches on the shelf you can view and manipulate them |
|
127 |
with the ``shelf`` command. Run ``bzr shelf -h`` for more information |
|
128 |
about how to do this. |
|
129 |
||
130 |
||
131 |
shell |
|
132 |
----- |
|
133 |
||
134 |
``bzr shell`` starts up a command interpreter than understands |
|
135 |
Bazaar commands natively. This has several advantages: |
|
136 |
||
137 |
* There's no need to type ``bzr`` at the front of every command. |
|
138 |
||
139 |
* Intelligent auto-completion is provided. |
|
140 |
||
141 |
* Commands run slightly faster as there's no need to load Bazaar's |
|
142 |
libraries each time. |
|
143 |
||
144 |
||
145 |
cdiff |
|
146 |
----- |
|
147 |
||
148 |
``bzr cdiff`` provides a colored version of ``bzr diff`` output. |
|
149 |
On GNU/Linux, UNIX and OS X, this is often used like this:: |
|
150 |
||
151 |
bzr cdiff | less -R |