~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/specifying_revisions.txt

  • Committer: John Arbash Meinel
  • Date: 2007-04-12 21:33:07 UTC
  • mfrom: (2413.4.1 api-doc-builders)
  • mto: This revision was merged to the branch mainline in revision 2566.
  • Revision ID: john@arbash-meinel.com-20070412213307-kuh07cnzaud12wx1
[merge] api-doc-builder and remove the pydoctor build code for now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Specifying revisions
2
 
====================
3
 
 
4
 
Revision identifiers and ranges
5
 
-------------------------------
6
 
 
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
=============================
 
2
Specifying revision in Bazaar
 
3
=============================
 
4
 
 
5
Description of the subarguments for ``-r`` as used by commands such as
 
6
``bzr log`` and ``bzr merge``.
 
7
 
 
8
You can get the online documentation with ``bzr help revisionspec``.
 
9
 
 
10
Revision specs and ranges
 
11
=========================
 
12
 
 
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.
 
15
 
 
16
To specify a range of revisions, use for example::
10
17
 
11
18
    $ bzr log -r 1..4
12
19
 
15
22
    $ bzr log -r 1..
16
23
    $ bzr log -r ..4
17
24
 
18
 
Some commands take only one revision, not a range. For example::
 
25
Note:
 
26
    Omitting the lower bound doesn't work on versions of ``bzr`` prior to 0.14.
 
27
 
 
28
Other commands, like ``bzr cat`` take only one revision, not a range, like::
19
29
 
20
30
    $ bzr cat -r 42 foo.c
21
31
 
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::
24
 
 
25
 
    $ bzr diff -c 42
26
 
 
27
 
 
28
 
Available revision identifiers
29
 
------------------------------
30
 
 
31
 
The revision, or the bounds of the range, can be given using
32
 
different format specifications as shown below.
 
32
Available revision specs
 
33
========================
 
34
 
 
35
The revision, or the bounds of the range, can be one of
33
36
 
34
37
 +----------------------+------------------------------------+
35
38
 |  argument type       | description                        |
36
39
 +----------------------+------------------------------------+
37
40
 | *number*             | revision number                    |
38
41
 +----------------------+------------------------------------+
39
 
 | **revno**:*number*   | revision number                    |
 
42
 | **revno**:*number*   | positive revision number           |
40
43
 +----------------------+------------------------------------+
41
44
 | **last**:*number*    | negative revision number           |
42
45
 +----------------------+------------------------------------+
43
 
 | *guid*               | globally unique revision id        |
44
 
 +----------------------+------------------------------------+
45
46
 | **revid**:*guid*     | globally unique revision id        |
46
47
 +----------------------+------------------------------------+
47
48
 | **before**:*rev*     | leftmost parent of ''rev''         |
48
49
 +----------------------+------------------------------------+
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      |
 
50
 | **date**:*value*     | first entry after a given date     |
56
51
 +----------------------+------------------------------------+
57
52
 | **ancestor**:*path*  | last merged revision from a branch |
58
53
 +----------------------+------------------------------------+
59
54
 | **branch**:*path*    | latest revision on another branch  |
60
55
 +----------------------+------------------------------------+
61
 
 | **submit**:*path*    | common ancestor with submit branch |
62
 
 +----------------------+------------------------------------+
63
 
 
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.
67
 
 
68
 
.. _Revision Identifiers: ../user-reference/index.html#revision-identifiers
69
56
 
70
57
Numbers
71
 
~~~~~~~
 
58
-------
72
59
 
73
60
Positive numbers denote revision numbers in the current branch. Revision
74
61
numbers are labelled as "revno" in the output of ``bzr log``.  To display
83
70
 
84
71
    $ bzr log -r -10..
85
72
 
 
73
revno, last
 
74
-----------
 
75
 
 
76
**revno**:*number*
 
77
    The same as *number*, except that negative numbers are not allowed.
 
78
 
 
79
**last**:*number*
 
80
    The same as -''number''. **last:1** means the last commited revision.
 
81
 
86
82
revid
87
 
~~~~~
 
83
-----
88
84
 
89
 
**revid** allows specifying an internal revision ID, as shown by ``bzr
90
 
log --show-ids`` and some other commands.
 
85
**revid** allows specifying a an internal revision ID, as shown by ``bzr
 
86
log`` and some other commands.
91
87
 
92
88
For example::
93
89
 
94
90
    $ bzr log -r revid:Matthieu.Moy@imag.fr-20051026185030-93c7cad63ee570df
95
91
 
 
92
 
96
93
before
97
 
~~~~~~
 
94
------
98
95
 
99
96
**before**
100
97
    ''rev'' specifies the leftmost parent of ''rev'', that is the revision
101
98
    that appears before ''rev'' in the revision history, or the revision that
102
 
    was current when ''rev'' was committed.
 
99
    was current when ''rev'' what comitted.
103
100
 
104
101
''rev'' can be any revision specifier and may be chained.
105
102
 
111
108
    ...
112
109
 
113
110
date
114
 
~~~~
 
111
----
115
112
 
116
113
**date**
117
114
    ''value'' matches the first history entry after a given date, either at
131
128
    $ bzr log -r date:yesterday..date:today
132
129
 
133
130
Ancestor
134
 
~~~~~~~~
 
131
--------
135
132
 
136
133
**ancestor**:*path*
137
 
    specifies the common ancestor between the current branch and a
 
134
    specifies the common ancestor between the current branch and a 
138
135
    different branch. This is the same ancestor that would be used for
139
136
    merging purposes.
140
137
 
146
143
    $ bzr diff -r ancestor:../parent
147
144
 
148
145
Branch
149
 
~~~~~~
 
146
------
150
147
 
151
148
branch
152
149
   ``path`` specifies the latest revision in another branch.