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::
4
Revision specs and ranges
5
-------------------------
7
``bzr`` has a very expressive way to specify a revision, or a range of revisions.
8
We'll take the example of the ``log`` command.
10
To specify a range of revisions, use for example::
18
Some commands take only one revision, not a range. For example::
20
Omitting the lower bound doesn't work on versions of ``bzr`` prior to 0.14.
22
Other commands, like ``bzr cat`` take only one revision, not a range, like::
20
24
$ bzr cat -r 42 foo.c
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.
26
Available revision specs
27
------------------------
29
The revision, or the bounds of the range, can be one of
34
31
+----------------------+------------------------------------+
35
32
| argument type | description |
36
33
+----------------------+------------------------------------+
37
34
| *number* | revision number |
38
35
+----------------------+------------------------------------+
39
| **revno**:*number* | revision number |
36
| **revno**:*number* | positive revision number |
40
37
+----------------------+------------------------------------+
41
38
| **last**:*number* | negative revision number |
42
39
+----------------------+------------------------------------+
43
| *guid* | globally unique revision id |
44
+----------------------+------------------------------------+
45
40
| **revid**:*guid* | globally unique revision id |
46
41
+----------------------+------------------------------------+
47
42
| **before**:*rev* | leftmost parent of ''rev'' |
48
43
+----------------------+------------------------------------+
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 |
44
| **date**:*value* | first entry after a given date |
56
45
+----------------------+------------------------------------+
57
46
| **ancestor**:*path* | last merged revision from a branch |
58
47
+----------------------+------------------------------------+
59
48
| **branch**:*path* | latest revision on another branch |
60
49
+----------------------+------------------------------------+
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
71
The same as *number*, except that negative numbers are not allowed.
74
The same as -''number''. **last:1** means the last commited revision.
89
79
**revid** allows specifying a an internal revision ID, as shown by ``bzr
90
log --show-ids`` and some other commands.
80
log`` and some other commands.
94
84
$ bzr log -r revid:Matthieu.Moy@imag.fr-20051026185030-93c7cad63ee570df
100
91
''rev'' specifies the leftmost parent of ''rev'', that is the revision
101
92
that appears before ''rev'' in the revision history, or the revision that
102
was current when ''rev'' was committed.
93
was current when ''rev'' what comitted.
104
95
''rev'' can be any revision specifier and may be chained.