~bzr-pqm/bzr/bzr.dev

1861.2.6 by Alexander Belchenko
branding: change Bazaar-NG to Bazaar
1
=============================
2
Specifying revision in Bazaar
3
=============================
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
4
5
Description of the subarguments for ``-r`` as used by commands such as
6
**bzr log** and **bzr merge**.
7
1610.2.2 by James Blackwell
Now they look good in rst2html
8
Revision specs and ranges
9
=========================
1610.2.1 by James Blackwell
Copied in docs for wiki & First round cleanup
10
1610.2.2 by James Blackwell
Now they look good in rst2html
11
**bzr** has a very expressive way to specify a revision, or a range of revisions.
12
We'll take the example of the **log** command.
1610.2.1 by James Blackwell
Copied in docs for wiki & First round cleanup
13
14
To specify a range of revisions, use for example::
15
16
    $ bzr log -r 1..4
17
18
You can omit one bound like::
19
20
    $ bzr log -r 1..
21
    $ bzr log -r ..4
22
23
Note::
24
    Omitting the lower bound doesn't work on currently released versions.
25
1610.2.2 by James Blackwell
Now they look good in rst2html
26
Other commands, like **bzr cat** take only one revision, not a range, like::
1610.2.1 by James Blackwell
Copied in docs for wiki & First round cleanup
27
28
    $ bzr cat -r 42 foo.c
29
1610.2.2 by James Blackwell
Now they look good in rst2html
30
Available revision specs
31
========================
32
33
The revision, or the bounds of the range, can be one of
34
35
 +----------------------+------------------------------------+
36
 |  argument type       | description                        |
37
 +----------------------+------------------------------------+
38
 | *number*             | revision number                    |
39
 +----------------------+------------------------------------+
40
 | **revno**:*number*   | positive revision number           |
41
 +----------------------+------------------------------------+
42
 | **last**:*number*    | negative revision number           |
43
 +----------------------+------------------------------------+
44
 | **revid**:*guid*     | globally unique revision id        |
45
 +----------------------+------------------------------------+
46
 | **before**:*rev*     | leftmost parent of ''rev''         |
47
 +----------------------+------------------------------------+
48
 | **date**:*value*     | first entry after a given date     |
49
 +----------------------+------------------------------------+
50
 | **ancestor**:*path*  | last merged revision from a branch |
51
 +----------------------+------------------------------------+
52
 | **branch**:*path*    | latest revision on another branch  |
53
 +----------------------+------------------------------------+
1610.2.1 by James Blackwell
Copied in docs for wiki & First round cleanup
54
55
Numbers
56
-------
57
58
Positive numbers denote revision numbers in the current branch. Revision
1610.2.2 by James Blackwell
Now they look good in rst2html
59
numbers are labelled as "revno" in the output of **bzr log**.  To display
60
the log for the first ten revisions::
1610.2.1 by James Blackwell
Copied in docs for wiki & First round cleanup
61
62
    $ bzr log -r ..10
63
64
Negative numbers count from the latest revision, -1 is the last committed
65
revision.
66
67
To display the log for the last ten revisions::
68
69
    $ bzr log -r -10..
70
71
revno, last
72
-----------
73
1610.2.2 by James Blackwell
Now they look good in rst2html
74
**revno**:*number*
75
    The same as *number*, except that negative numbers are not allowed.
1610.2.1 by James Blackwell
Copied in docs for wiki & First round cleanup
76
1610.2.2 by James Blackwell
Now they look good in rst2html
77
**last**:*number*
78
    The same as -''number''. **last:1** means the last commited revision.
1610.2.1 by James Blackwell
Copied in docs for wiki & First round cleanup
79
80
revid
81
-----
82
1610.2.2 by James Blackwell
Now they look good in rst2html
83
**revid** allows specifying a an internal revision ID, as show by **bzr
84
testament** and some other commands.
1610.2.1 by James Blackwell
Copied in docs for wiki & First round cleanup
85
86
For example::
87
88
    $ bzr log -r revid:Matthieu.Moy@imag.fr-20051026185030-93c7cad63ee570df
89
90
91
before
92
------
93
1610.2.2 by James Blackwell
Now they look good in rst2html
94
**before**
95
    ''rev'' specifies the leftmost parent of ''rev'', that is the revision
96
    that appears before ''rev'' in the revision history, or the revision that
97
    was current when ''rev'' what comitted.
1610.2.1 by James Blackwell
Copied in docs for wiki & First round cleanup
98
99
''rev'' can be any revision specifier.
100
101
For example::
102
103
    $ bzr log -r before:before:4
104
    ...
105
    revno: 2
106
    ...
107
108
date
109
----
110
1610.2.2 by James Blackwell
Now they look good in rst2html
111
**date**
112
    ''value'' matches the first history entry after a given date, either at
113
    midnight or at a specified time.
1610.2.1 by James Blackwell
Copied in docs for wiki & First round cleanup
114
115
Legal values are:
116
1610.2.2 by James Blackwell
Now they look good in rst2html
117
 * **yesterday**
118
 * **today**
119
 * **tomorrow**
120
 * A **YYYY-MM-DD** format date.
121
 * A **YYYY-MM-DD,HH:MM:SS** format date/time, seconds are optional (note the
1610.2.1 by James Blackwell
Copied in docs for wiki & First round cleanup
122
   comma)
123
124
The proper way of saying "give me all the log entries for today" is::
125
126
    $ bzr log -r date:yesterday..date:today
127
128
Ancestor
129
--------
130
1610.2.2 by James Blackwell
Now they look good in rst2html
131
**ancestor**:*path*
132
    specifies the common ancestor between the current branch,and a 
133
    different branch. This is the same ancestor that would be used for
134
    merging purposes.
135
136
*path* may be the URL of a remote branch, or the file path to a local branch.
137
138
For example, to see what changes were made on a branch since it was forked
139
off **../parent**::
140
141
    $ bzr diff -r ancestor:../parent
1610.2.1 by James Blackwell
Copied in docs for wiki & First round cleanup
142
143
Branch
144
------
145
1610.2.2 by James Blackwell
Now they look good in rst2html
146
branch
147
   ''path'' specifies the latest revision in another branch.
1610.2.1 by James Blackwell
Copied in docs for wiki & First round cleanup
148
149
''path'' may be the URL of a remote branch, or the file path to a local branch.
150
1610.2.2 by James Blackwell
Now they look good in rst2html
151
For example, to get the differences between this and another branch::
152
153
    $ bzr diff -r branch:http://example.com/bzr/foo.dev
154