~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/en/user-guide/specifying_revisions.txt

  • Committer: Ian Clatworthy
  • Date: 2009-09-09 11:43:10 UTC
  • mto: (4634.37.2 prepare-2.0)
  • mto: This revision was merged to the branch mainline in revision 4689.
  • Revision ID: ian.clatworthy@canonical.com-20090909114310-glw7tv76i5gnx9pt
put rules back in Makefile supporting plain-style docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
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::
 
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::
17
10
 
18
11
    $ bzr log -r 1..4
19
12
 
22
15
    $ bzr log -r 1..
23
16
    $ bzr log -r ..4
24
17
 
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::
 
18
Some commands take only one revision, not a range. For example::
29
19
 
30
20
    $ bzr cat -r 42 foo.c
31
21
 
32
 
Available revision specs
33
 
========================
34
 
 
35
 
The revision, or the bounds of the range, can be one of
 
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.
36
33
 
37
34
 +----------------------+------------------------------------+
38
35
 |  argument type       | description                        |
49
46
 +----------------------+------------------------------------+
50
47
 | **date**:*value*     | first entry after a given date     |
51
48
 +----------------------+------------------------------------+
 
49
 | **tag**:*value*      | revision matching a given tag      |
 
50
 +----------------------+------------------------------------+
52
51
 | **ancestor**:*path*  | last merged revision from a branch |
53
52
 +----------------------+------------------------------------+
54
53
 | **branch**:*path*    | latest revision on another branch  |
55
54
 +----------------------+------------------------------------+
 
55
 | **submit**:*path*    | common ancestor with submit branch |
 
56
 +----------------------+------------------------------------+
 
57
 
 
58
A brief introduction to some of these formats is given below.
 
59
For complete details, see `Revision Identifiers`_ in the
 
60
Bazaar User Reference.
 
61
 
 
62
.. _Revision Identifiers: ../user-reference/bzr_man.html#revision-identifiers
56
63
 
57
64
Numbers
58
 
-------
 
65
~~~~~~~
59
66
 
60
67
Positive numbers denote revision numbers in the current branch. Revision
61
68
numbers are labelled as "revno" in the output of ``bzr log``.  To display
70
77
 
71
78
    $ bzr log -r -10..
72
79
 
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
 
 
82
80
revid
83
 
-----
 
81
~~~~~
84
82
 
85
83
**revid** allows specifying a an internal revision ID, as shown by ``bzr
86
84
log`` and some other commands.
89
87
 
90
88
    $ bzr log -r revid:Matthieu.Moy@imag.fr-20051026185030-93c7cad63ee570df
91
89
 
92
 
 
93
90
before
94
 
------
 
91
~~~~~~
95
92
 
96
93
**before**
97
94
    ''rev'' specifies the leftmost parent of ''rev'', that is the revision
98
95
    that appears before ''rev'' in the revision history, or the revision that
99
 
    was current when ''rev'' what comitted.
 
96
    was current when ''rev'' was committed.
100
97
 
101
98
''rev'' can be any revision specifier and may be chained.
102
99
 
108
105
    ...
109
106
 
110
107
date
111
 
----
 
108
~~~~
112
109
 
113
110
**date**
114
111
    ''value'' matches the first history entry after a given date, either at
128
125
    $ bzr log -r date:yesterday..date:today
129
126
 
130
127
Ancestor
131
 
--------
 
128
~~~~~~~~
132
129
 
133
130
**ancestor**:*path*
134
131
    specifies the common ancestor between the current branch and a 
143
140
    $ bzr diff -r ancestor:../parent
144
141
 
145
142
Branch
146
 
------
 
143
~~~~~~
147
144
 
148
145
branch
149
146
   ``path`` specifies the latest revision in another branch.