1
= Revision specs and ranges =
1
Revision specs and ranges
2
=========================
3
`bzr` has a very expressive way to specify a revision, or a range of revisions.
4
We'll take the example of the `log` command.
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.
6
7
To specify a range of revisions, use for example::
16
17
Omitting the lower bound doesn't work on currently released versions.
18
Other commands, like ```bzr cat``` take only one revision, not a range, like::
19
Other commands, like **bzr cat** take only one revision, not a range, like::
20
21
$ bzr cat -r 42 foo.c
22
= Available revision specs =
24
The revision, or the bounds of the range, can be one of::
26
+--------------------+------------------------------------+
27
| argument type | description |
28
+--------------------+------------------------------------+
29
| ''number'' | revision number |
30
+--------------------+------------------------------------+
31
| `revno:`''number'' | positive revision number |
32
+--------------------+------------------------------------+
33
| `last:`''number'' | negative revision number |
34
+--------------------+------------------------------------+
35
| `revid:`''guid'' | globally unique revision id |
36
+--------------------+------------------------------------+
37
| `before:`''rev'' | leftmost parent of ''rev'' |
38
+--------------------+------------------------------------+
39
| `date:`''value'' | first entry after a given date |
40
+--------------------+------------------------------------+
41
| `ancestor:`''path''| last merged revision from a branch |
42
+--------------------+------------------------------------+
43
| `branch:`''path'' | latest revision on another branch |
44
+--------------------+------------------------------------+
23
Available revision specs
24
========================
26
The revision, or the bounds of the range, can be one of
28
+----------------------+------------------------------------+
29
| argument type | description |
30
+----------------------+------------------------------------+
31
| *number* | revision number |
32
+----------------------+------------------------------------+
33
| **revno**:*number* | positive revision number |
34
+----------------------+------------------------------------+
35
| **last**:*number* | negative revision number |
36
+----------------------+------------------------------------+
37
| **revid**:*guid* | globally unique revision id |
38
+----------------------+------------------------------------+
39
| **before**:*rev* | leftmost parent of ''rev'' |
40
+----------------------+------------------------------------+
41
| **date**:*value* | first entry after a given date |
42
+----------------------+------------------------------------+
43
| **ancestor**:*path* | last merged revision from a branch |
44
+----------------------+------------------------------------+
45
| **branch**:*path* | latest revision on another branch |
46
+----------------------+------------------------------------+
49
51
Positive numbers denote revision numbers in the current branch. Revision
50
numbers are labelled as "revno" in the output of `bzr log`.
52
numbers are labelled as "revno" in the output of **bzr log**. To display
53
the log for the first ten revisions::
52
To display the log for the first ten revisions::
55
57
Negative numbers count from the latest revision, -1 is the last committed
65
`revno:`''number'' is the same as ''number'', except that negative numbers are
68
The same as *number*, except that negative numbers are not allowed.
68
`last:`''number'' is the same as -''number''. `last:1` means the last commited
71
The same as -''number''. **last:1** means the last commited revision.
74
`revid` allows specifying a an internal revision ID, as show by `bzr testament` and some other commands.
76
**revid** allows specifying a an internal revision ID, as show by **bzr
77
testament** and some other commands.
78
81
$ bzr log -r revid:Matthieu.Moy@imag.fr-20051026185030-93c7cad63ee570df
85
`before:`''rev'' specifies the leftmost parent of ''rev'', that is the revision
86
that appears before ''rev'' in the revision history, or the revision that was
87
current when ''rev'' what comitted.
88
''rev'' specifies the leftmost parent of ''rev'', that is the revision
89
that appears before ''rev'' in the revision history, or the revision that
90
was current when ''rev'' what comitted.
89
92
''rev'' can be any revision specifier.
101
`date:`''value'' matches the first history entry after a given date, either at
102
midnight or at a specified time.
105
''value'' matches the first history entry after a given date, either at
106
midnight or at a specified time.
104
108
Legal values are:
109
* A `YYYY-MM-DD` format date.
110
* A `YYYY-MM-DD,HH:MM:SS` format date/time, seconds are optional (note the
113
* A **YYYY-MM-DD** format date.
114
* A **YYYY-MM-DD,HH:MM:SS** format date/time, seconds are optional (note the
113
117
The proper way of saying "give me all the log entries for today" is::
120
`ancestor:`''path'' specifies the common ancestor between the current branch, and a different branch. This is the same ancestor that would be used for merging purposes.
122
''path'' may be the URL of a remote branch, or the file path to a local branch.
124
For example, to see what changes were made on a branch since it was forked off ``../parent``: {{{
125
$ bzr diff -r ancestor:../parent
125
specifies the common ancestor between the current branch,and a
126
different branch. This is the same ancestor that would be used for
129
*path* may be the URL of a remote branch, or the file path to a local branch.
131
For example, to see what changes were made on a branch since it was forked
134
$ bzr diff -r ancestor:../parent
131
`branch:`''path'' specifies the latest revision in another branch.
140
''path'' specifies the latest revision in another branch.
133
142
''path'' may be the URL of a remote branch, or the file path to a local branch.
135
For example, to get the differences between this and another branch:{{{
136
$ bzr diff -r branch:http://example.com/bzr/foo.dev
144
For example, to get the differences between this and another branch::
146
$ bzr diff -r branch:http://example.com/bzr/foo.dev