1610.2.2
by James Blackwell
Now they look good in rst2html |
1 |
Revision specs and ranges |
2 |
========================= |
|
1610.2.1
by James Blackwell
Copied in docs for wiki & First round cleanup |
3 |
|
1610.2.2
by James Blackwell
Now they look good in rst2html |
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. |
|
1610.2.1
by James Blackwell
Copied in docs for wiki & First round cleanup |
6 |
|
7 |
To specify a range of revisions, use for example:: |
|
8 |
||
9 |
$ bzr log -r 1..4 |
|
10 |
||
11 |
You can omit one bound like:: |
|
12 |
||
13 |
$ bzr log -r 1.. |
|
14 |
$ bzr log -r ..4 |
|
15 |
||
16 |
Note:: |
|
17 |
Omitting the lower bound doesn't work on currently released versions. |
|
18 |
||
1610.2.2
by James Blackwell
Now they look good in rst2html |
19 |
Other commands, like **bzr cat** take only one revision, not a range, like:: |
1610.2.1
by James Blackwell
Copied in docs for wiki & First round cleanup |
20 |
|
21 |
$ bzr cat -r 42 foo.c |
|
22 |
||
1610.2.2
by James Blackwell
Now they look good in rst2html |
23 |
Available revision specs |
24 |
======================== |
|
25 |
||
26 |
The revision, or the bounds of the range, can be one of |
|
27 |
||
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 |
+----------------------+------------------------------------+ |
|
1610.2.1
by James Blackwell
Copied in docs for wiki & First round cleanup |
47 |
|
48 |
Numbers |
|
49 |
------- |
|
50 |
||
51 |
Positive numbers denote revision numbers in the current branch. Revision |
|
1610.2.2
by James Blackwell
Now they look good in rst2html |
52 |
numbers are labelled as "revno" in the output of **bzr log**. To display |
53 |
the log for the first ten revisions:: |
|
1610.2.1
by James Blackwell
Copied in docs for wiki & First round cleanup |
54 |
|
55 |
$ bzr log -r ..10 |
|
56 |
||
57 |
Negative numbers count from the latest revision, -1 is the last committed |
|
58 |
revision. |
|
59 |
||
60 |
To display the log for the last ten revisions:: |
|
61 |
||
62 |
$ bzr log -r -10.. |
|
63 |
||
64 |
revno, last |
|
65 |
----------- |
|
66 |
||
1610.2.2
by James Blackwell
Now they look good in rst2html |
67 |
**revno**:*number* |
68 |
The same as *number*, except that negative numbers are not allowed. |
|
1610.2.1
by James Blackwell
Copied in docs for wiki & First round cleanup |
69 |
|
1610.2.2
by James Blackwell
Now they look good in rst2html |
70 |
**last**:*number* |
71 |
The same as -''number''. **last:1** means the last commited revision. |
|
1610.2.1
by James Blackwell
Copied in docs for wiki & First round cleanup |
72 |
|
73 |
revid |
|
74 |
----- |
|
75 |
||
1610.2.2
by James Blackwell
Now they look good in rst2html |
76 |
**revid** allows specifying a an internal revision ID, as show by **bzr |
77 |
testament** and some other commands. |
|
1610.2.1
by James Blackwell
Copied in docs for wiki & First round cleanup |
78 |
|
79 |
For example:: |
|
80 |
||
81 |
$ bzr log -r revid:Matthieu.Moy@imag.fr-20051026185030-93c7cad63ee570df |
|
82 |
||
83 |
||
84 |
before |
|
85 |
------ |
|
86 |
||
1610.2.2
by James Blackwell
Now they look good in rst2html |
87 |
**before** |
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. |
|
1610.2.1
by James Blackwell
Copied in docs for wiki & First round cleanup |
91 |
|
92 |
''rev'' can be any revision specifier. |
|
93 |
||
94 |
For example:: |
|
95 |
||
96 |
$ bzr log -r before:before:4 |
|
97 |
... |
|
98 |
revno: 2 |
|
99 |
... |
|
100 |
||
101 |
date |
|
102 |
---- |
|
103 |
||
1610.2.2
by James Blackwell
Now they look good in rst2html |
104 |
**date** |
105 |
''value'' matches the first history entry after a given date, either at |
|
106 |
midnight or at a specified time. |
|
1610.2.1
by James Blackwell
Copied in docs for wiki & First round cleanup |
107 |
|
108 |
Legal values are: |
|
109 |
||
1610.2.2
by James Blackwell
Now they look good in rst2html |
110 |
* **yesterday** |
111 |
* **today** |
|
112 |
* **tomorrow** |
|
113 |
* A **YYYY-MM-DD** format date. |
|
114 |
* A **YYYY-MM-DD,HH:MM:SS** format date/time, seconds are optional (note the |
|
1610.2.1
by James Blackwell
Copied in docs for wiki & First round cleanup |
115 |
comma) |
116 |
||
117 |
The proper way of saying "give me all the log entries for today" is:: |
|
118 |
||
119 |
$ bzr log -r date:yesterday..date:today |
|
120 |
||
121 |
Ancestor |
|
122 |
-------- |
|
123 |
||
1610.2.2
by James Blackwell
Now they look good in rst2html |
124 |
**ancestor**:*path* |
125 |
specifies the common ancestor between the current branch,and a |
|
126 |
different branch. This is the same ancestor that would be used for |
|
127 |
merging purposes. |
|
128 |
||
129 |
*path* may be the URL of a remote branch, or the file path to a local branch. |
|
130 |
||
131 |
For example, to see what changes were made on a branch since it was forked |
|
132 |
off **../parent**:: |
|
133 |
||
134 |
$ bzr diff -r ancestor:../parent |
|
1610.2.1
by James Blackwell
Copied in docs for wiki & First round cleanup |
135 |
|
136 |
Branch |
|
137 |
------ |
|
138 |
||
1610.2.2
by James Blackwell
Now they look good in rst2html |
139 |
branch |
140 |
''path'' specifies the latest revision in another branch. |
|
1610.2.1
by James Blackwell
Copied in docs for wiki & First round cleanup |
141 |
|
142 |
''path'' may be the URL of a remote branch, or the file path to a local branch. |
|
143 |
||
1610.2.2
by James Blackwell
Now they look good in rst2html |
144 |
For example, to get the differences between this and another branch:: |
145 |
||
146 |
$ bzr diff -r branch:http://example.com/bzr/foo.dev |
|
147 |