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::
1
Revision specs and ranges
2
=========================
4
**bzr** has a very expressive way to specify a revision, or a range of revisions.
5
We'll take the example of the **log** command.
7
To specify a range of revisions, use for example::
18
Some commands take only one revision, not a range. For example::
17
Omitting the lower bound doesn't work on currently released versions.
19
Other commands, like **bzr cat** take only one revision, not a range, like::
20
21
$ 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.
23
Available revision specs
24
========================
26
The revision, or the bounds of the range, can be one of
34
28
+----------------------+------------------------------------+
35
29
| argument type | description |
36
30
+----------------------+------------------------------------+
37
31
| *number* | revision number |
38
32
+----------------------+------------------------------------+
39
| **revno**:*number* | revision number |
33
| **revno**:*number* | positive revision number |
40
34
+----------------------+------------------------------------+
41
35
| **last**:*number* | negative revision number |
42
36
+----------------------+------------------------------------+
43
| *guid* | globally unique revision id |
44
+----------------------+------------------------------------+
45
37
| **revid**:*guid* | globally unique revision id |
46
38
+----------------------+------------------------------------+
47
39
| **before**:*rev* | leftmost parent of ''rev'' |
48
40
+----------------------+------------------------------------+
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 |
41
| **date**:*value* | first entry after a given date |
56
42
+----------------------+------------------------------------+
57
43
| **ancestor**:*path* | last merged revision from a branch |
58
44
+----------------------+------------------------------------+
59
45
| **branch**:*path* | latest revision on another branch |
60
46
+----------------------+------------------------------------+
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
73
51
Positive numbers denote revision numbers in the current branch. Revision
74
numbers are labelled as "revno" in the output of ``bzr log``. To display
52
numbers are labelled as "revno" in the output of **bzr log**. To display
75
53
the log for the first ten revisions::
68
The same as *number*, except that negative numbers are not allowed.
71
The same as -''number''. **last:1** means the last commited revision.
89
**revid** allows specifying a an internal revision ID, as shown by ``bzr
90
log --show-ids`` and some other commands.
76
**revid** allows specifying a an internal revision ID, as show by **bzr
77
testament** and some other commands.
94
81
$ bzr log -r revid:Matthieu.Moy@imag.fr-20051026185030-93c7cad63ee570df
100
88
''rev'' specifies the leftmost parent of ''rev'', that is the revision
101
89
that appears before ''rev'' in the revision history, or the revision that
102
was current when ''rev'' was committed.
90
was current when ''rev'' what comitted.
104
''rev'' can be any revision specifier and may be chained.
92
''rev'' can be any revision specifier.
131
119
$ bzr log -r date:yesterday..date:today
136
124
**ancestor**:*path*
137
specifies the common ancestor between the current branch and a
125
specifies the common ancestor between the current branch,and a
138
126
different branch. This is the same ancestor that would be used for
139
127
merging purposes.
141
129
*path* may be the URL of a remote branch, or the file path to a local branch.
143
131
For example, to see what changes were made on a branch since it was forked
146
134
$ bzr diff -r ancestor:../parent
152
``path`` specifies the latest revision in another branch.
140
''path'' specifies the latest revision in another branch.
154
``path`` may be the URL of a remote branch, or the file path to a local branch.
142
''path'' may be the URL of a remote branch, or the file path to a local branch.
156
144
For example, to get the differences between this and another branch::