~ubuntu-branches/ubuntu/karmic/bzr/karmic-proposed

« back to all changes in this revision

Viewing changes to doc/en/user-guide/bzrtools_plugin.txt

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2008-05-12 00:14:54 UTC
  • mfrom: (1.1.42 upstream)
  • Revision ID: james.westby@ubuntu.com-20080512001454-yjpajuiocykl48p9
Tags: 1.5~rc1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
BzrTools
 
2
========
 
3
 
 
4
Overview
 
5
--------
 
6
 
 
7
BzrTools is a collection of useful enhancements to Bazaar.
 
8
Here is a sample of the frequently used commands it provides.
 
9
 
 
10
 
 
11
shelve, shelf, unshelve
 
12
-----------------------
 
13
 
 
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.
 
17
 
 
18
For example, consider a working tree with one or more changes made ... ::
 
19
 
 
20
  $ bzr diff
 
21
  === modified file 'description.txt'
 
22
  --- description.txt
 
23
  +++ description.txt
 
24
  @@ -2,7 +2,7 @@
 
25
   ===============
 
26
   
 
27
   These plugins
 
28
  -by Michael Ellerman
 
29
  +written by Michael Ellerman
 
30
   provide a very
 
31
   fine-grained 'undo'
 
32
   facility
 
33
  @@ -11,6 +11,6 @@
 
34
   This allows you to 
 
35
   undo some of
 
36
   your changes,
 
37
  -commit, and get
 
38
  +perform a commit, and get
 
39
   back to where you
 
40
   were before.
 
41
 
 
42
The ``shelve`` command interactively asks which changes
 
43
you want to retain in the working tree::
 
44
 
 
45
  $ bzr shelve
 
46
  --- description.txt
 
47
  +++ description.txt
 
48
  @@ -2,7 +2,7 @@
 
49
   ===============
 
50
   
 
51
   These plugins
 
52
  -by Michael Ellerman
 
53
  +written by Michael Ellerman
 
54
   provide a very
 
55
   fine-grained 'undo'
 
56
   facility
 
57
 
 
58
  Keep this change? (1 of 2) [nydisq?] (n): y
 
59
  --- description.txt
 
60
  +++ description.txt
 
61
  @@ -11,6 +11,6 @@
 
62
   This allows you to 
 
63
   undo some of
 
64
   your changes,
 
65
  -commit, and get
 
66
  +perform a commit, and get
 
67
   back to where you
 
68
   were before.
 
69
 
 
70
  Keep this change? (2 of 2) [nydisq?] (n): n
 
71
 
 
72
  Status:
 
73
    description.txt
 
74
      1 hunks to be shelved
 
75
      1 hunks to be kept
 
76
 
 
77
  Shelve these changes, or restart? [yrsiq?] (y): y
 
78
  Saving shelved patches to /tmp/proj/.bzr-shelf
 
79
  Reverting shelved patches
 
80
  Diff status is now:
 
81
   description.txt | 2 +-
 
82
   1 files changes, 1 insertions(+), 1 deletions(-)
 
83
 
 
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::
 
89
 
 
90
  $ bzr diff
 
91
  === modified file 'description.txt'
 
92
  --- description.txt
 
93
  +++ description.txt
 
94
  @@ -2,7 +2,7 @@
 
95
   ===============
 
96
   
 
97
   These plugins
 
98
  -by Michael Ellerman
 
99
  +written by Michael Ellerman
 
100
   provide a very
 
101
   fine-grained 'undo'
 
102
   facility
 
103
 
 
104
Great - you're ready to commit::
 
105
 
 
106
  $ bzr commit -m "improve first sentence"
 
107
 
 
108
At some later time, you can bring the shelved changes back into the
 
109
working tree using ``unshelve``::
 
110
 
 
111
  $ bzr unshelve
 
112
  Reapplying shelved patches 
 
113
  Diff status is now:
 
114
   description.txt | 4 ++--
 
115
   1 files changes, 2 insertions(+), 2 deletions(-)
 
116
 
 
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.)
 
123
  
 
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.
 
127
 
 
128
 
 
129
shell
 
130
-----
 
131
 
 
132
``bzr shell`` starts up a command interpreter than understands
 
133
Bazaar commands natively. This has several advantages:
 
134
 
 
135
 * There's no need to type ``bzr`` at the front of every command.
 
136
 
 
137
 * Intelligent auto-completion is provided.
 
138
 
 
139
 * Commands run slightly faster as there's no need to load Bazaar's
 
140
   libraries each time.
 
141
 
 
142
 
 
143
cdiff
 
144
-----
 
145
 
 
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::
 
148
 
 
149
  bzr cdiff | less -R