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
You can get the online documentation with ``bzr help revisionspec``.
10
Revision specs and ranges
11
=========================
13
``bzr`` has a very expressive way to specify a revision, or a range of revisions.
14
We'll take the example of the ``log`` command.
16
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::
26
Omitting the lower bound doesn't work on versions of ``bzr`` prior to 0.14.
28
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::
30
20
$ bzr cat -r 42 foo.c
32
Available revision specs
33
========================
35
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.
37
34
+----------------------+------------------------------------+
38
35
| argument type | description |
39
36
+----------------------+------------------------------------+
40
37
| *number* | revision number |
41
38
+----------------------+------------------------------------+
42
| **revno**:*number* | positive revision number |
39
| **revno**:*number* | revision number |
43
40
+----------------------+------------------------------------+
44
41
| **last**:*number* | negative revision number |
45
42
+----------------------+------------------------------------+
43
| *guid* | globally unique revision id |
44
+----------------------+------------------------------------+
46
45
| **revid**:*guid* | globally unique revision id |
47
46
+----------------------+------------------------------------+
48
47
| **before**:*rev* | leftmost parent of ''rev'' |
49
48
+----------------------+------------------------------------+
50
| **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 |
51
56
+----------------------+------------------------------------+
52
57
| **ancestor**:*path* | last merged revision from a branch |
53
58
+----------------------+------------------------------------+
54
59
| **branch**:*path* | latest revision on another branch |
55
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/index.html#revision-identifiers
60
73
Positive numbers denote revision numbers in the current branch. Revision
61
74
numbers are labelled as "revno" in the output of ``bzr log``. To display
77
The same as *number*, except that negative numbers are not allowed.
80
The same as -''number''. **last:1** means the last commited revision.
85
89
**revid** allows specifying a an internal revision ID, as shown by ``bzr
86
log`` and some other commands.
90
log --show-ids`` and some other commands.
90
94
$ bzr log -r revid:Matthieu.Moy@imag.fr-20051026185030-93c7cad63ee570df
97
100
''rev'' specifies the leftmost parent of ''rev'', that is the revision
98
101
that appears before ''rev'' in the revision history, or the revision that
99
was current when ''rev'' what comitted.
102
was current when ''rev'' was committed.
101
104
''rev'' can be any revision specifier and may be chained.