1
=============================
2
Specifying revision in Bazaar
3
=============================
5
Description of the subarguments for ``-r`` as used by commands such as
6
**bzr log** and **bzr merge**.
8
Revision specs and ranges
9
=========================
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.
14
To specify a range of revisions, use for example::
4
Revision identifiers and ranges
5
-------------------------------
7
Bazaar has a very expressive way to specify a revision or a range of revisions.
8
To specify a range of revisions, the upper and lower bounds are separated by the
9
``..`` symbol. For example::
24
Omitting the lower bound doesn't work on currently released versions.
26
Other commands, like **bzr cat** take only one revision, not a range, like::
18
Some commands take only one revision, not a range. For example::
28
20
$ bzr cat -r 42 foo.c
30
Available revision specs
31
========================
33
The revision, or the bounds of the range, can be one of
22
In other cases, a range is required but you want the length of the range to
23
be one. For commands where this is relevant, the ``-c`` option is used like this::
28
Available revision identifiers
29
------------------------------
31
The revision, or the bounds of the range, can be given using
32
different format specifications as shown below.
35
34
+----------------------+------------------------------------+
36
35
| argument type | description |
37
36
+----------------------+------------------------------------+
38
37
| *number* | revision number |
39
38
+----------------------+------------------------------------+
40
| **revno**:*number* | positive revision number |
39
| **revno**:*number* | revision number |
41
40
+----------------------+------------------------------------+
42
41
| **last**:*number* | negative revision number |
43
42
+----------------------+------------------------------------+
43
| *guid* | globally unique revision id |
44
+----------------------+------------------------------------+
44
45
| **revid**:*guid* | globally unique revision id |
45
46
+----------------------+------------------------------------+
46
47
| **before**:*rev* | leftmost parent of ''rev'' |
47
48
+----------------------+------------------------------------+
48
| **date**:*value* | first entry after a given date |
49
| *date-value* | first entry after a given date |
50
+----------------------+------------------------------------+
51
| **date**:*date-value*| first entry after a given date |
52
+----------------------+------------------------------------+
53
| *tag-name* | revision matching a given tag |
54
+----------------------+------------------------------------+
55
| **tag**:*tag-name* | revision matching a given tag |
49
56
+----------------------+------------------------------------+
50
57
| **ancestor**:*path* | last merged revision from a branch |
51
58
+----------------------+------------------------------------+
52
59
| **branch**:*path* | latest revision on another branch |
53
60
+----------------------+------------------------------------+
61
| **submit**:*path* | common ancestor with submit branch |
62
+----------------------+------------------------------------+
64
A brief introduction to some of these formats is given below.
65
For complete details, see `Revision Identifiers`_ in the
66
Bazaar User Reference.
68
.. _Revision Identifiers: ../user-reference/bzr_man.html#revision-identifiers
58
73
Positive numbers denote revision numbers in the current branch. Revision
59
numbers are labelled as "revno" in the output of **bzr log**. To display
74
numbers are labelled as "revno" in the output of ``bzr log``. To display
60
75
the log for the first ten revisions::
75
The same as *number*, except that negative numbers are not allowed.
78
The same as -''number''. **last:1** means the last commited revision.
83
**revid** allows specifying a an internal revision ID, as show by **bzr
84
testament** and some other commands.
89
**revid** allows specifying a an internal revision ID, as shown by ``bzr
90
log --show-ids`` and some other commands.
88
94
$ bzr log -r revid:Matthieu.Moy@imag.fr-20051026185030-93c7cad63ee570df
95
100
''rev'' specifies the leftmost parent of ''rev'', that is the revision
96
101
that appears before ''rev'' in the revision history, or the revision that
97
was current when ''rev'' what comitted.
102
was current when ''rev'' was committed.
99
''rev'' can be any revision specifier.
104
''rev'' can be any revision specifier and may be chained.
126
131
$ bzr log -r date:yesterday..date:today
131
136
**ancestor**:*path*
132
specifies the common ancestor between the current branch,and a
137
specifies the common ancestor between the current branch and a
133
138
different branch. This is the same ancestor that would be used for
134
139
merging purposes.
136
141
*path* may be the URL of a remote branch, or the file path to a local branch.
138
143
For example, to see what changes were made on a branch since it was forked
141
146
$ bzr diff -r ancestor:../parent
147
''path'' specifies the latest revision in another branch.
152
``path`` specifies the latest revision in another branch.
149
''path'' may be the URL of a remote branch, or the file path to a local branch.
154
``path`` may be the URL of a remote branch, or the file path to a local branch.
151
156
For example, to get the differences between this and another branch::