~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/specifying_revisions.txt

  • Committer: Wouter van Heyst
  • Date: 2006-06-06 22:37:30 UTC
  • mto: This revision was merged to the branch mainline in revision 1752.
  • Revision ID: larstiq@larstiq.dyndns.org-20060606223730-a308c5429fc6c617
change branch.{get,set}_parent to store a relative path but return full urls

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
Revision specs and ranges
 
2
=========================
 
3
 
 
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::
10
8
 
11
9
    $ bzr log -r 1..4
12
10
 
15
13
    $ bzr log -r 1..
16
14
    $ bzr log -r ..4
17
15
 
18
 
Some commands take only one revision, not a range. For example::
 
16
Note::
 
17
    Omitting the lower bound doesn't work on currently released versions.
 
18
 
 
19
Other commands, like **bzr cat** take only one revision, not a range, like::
19
20
 
20
21
    $ bzr cat -r 42 foo.c
21
22
 
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.
 
23
Available revision specs
 
24
========================
 
25
 
 
26
The revision, or the bounds of the range, can be one of
33
27
 
34
28
 +----------------------+------------------------------------+
35
29
 |  argument type       | description                        |
46
40
 +----------------------+------------------------------------+
47
41
 | **date**:*value*     | first entry after a given date     |
48
42
 +----------------------+------------------------------------+
49
 
 | **tag**:*value*      | revision matching a given tag      |
50
 
 +----------------------+------------------------------------+
51
43
 | **ancestor**:*path*  | last merged revision from a branch |
52
44
 +----------------------+------------------------------------+
53
45
 | **branch**:*path*    | latest revision on another branch  |
54
46
 +----------------------+------------------------------------+
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
63
47
 
64
48
Numbers
65
 
~~~~~~~
 
49
-------
66
50
 
67
51
Positive numbers denote revision numbers in the current branch. Revision
68
 
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
69
53
the log for the first ten revisions::
70
54
 
71
55
    $ bzr log -r ..10
77
61
 
78
62
    $ bzr log -r -10..
79
63
 
 
64
revno, last
 
65
-----------
 
66
 
 
67
**revno**:*number*
 
68
    The same as *number*, except that negative numbers are not allowed.
 
69
 
 
70
**last**:*number*
 
71
    The same as -''number''. **last:1** means the last commited revision.
 
72
 
80
73
revid
81
 
~~~~~
 
74
-----
82
75
 
83
 
**revid** allows specifying a an internal revision ID, as shown by ``bzr
84
 
log`` and some other commands.
 
76
**revid** allows specifying a an internal revision ID, as show by **bzr
 
77
testament** and some other commands.
85
78
 
86
79
For example::
87
80
 
88
81
    $ bzr log -r revid:Matthieu.Moy@imag.fr-20051026185030-93c7cad63ee570df
89
82
 
 
83
 
90
84
before
91
 
~~~~~~
 
85
------
92
86
 
93
87
**before**
94
88
    ''rev'' specifies the leftmost parent of ''rev'', that is the revision
95
89
    that appears before ''rev'' in the revision history, or the revision that
96
90
    was current when ''rev'' what comitted.
97
91
 
98
 
''rev'' can be any revision specifier and may be chained.
 
92
''rev'' can be any revision specifier.
99
93
 
100
94
For example::
101
95
 
105
99
    ...
106
100
 
107
101
date
108
 
~~~~
 
102
----
109
103
 
110
104
**date**
111
105
    ''value'' matches the first history entry after a given date, either at
125
119
    $ bzr log -r date:yesterday..date:today
126
120
 
127
121
Ancestor
128
 
~~~~~~~~
 
122
--------
129
123
 
130
124
**ancestor**:*path*
131
 
    specifies the common ancestor between the current branch and a 
 
125
    specifies the common ancestor between the current branch,and a 
132
126
    different branch. This is the same ancestor that would be used for
133
127
    merging purposes.
134
128
 
135
129
*path* may be the URL of a remote branch, or the file path to a local branch.
136
130
 
137
131
For example, to see what changes were made on a branch since it was forked
138
 
off ``../parent``::
 
132
off **../parent**::
139
133
 
140
134
    $ bzr diff -r ancestor:../parent
141
135
 
142
136
Branch
143
 
~~~~~~
 
137
------
144
138
 
145
139
branch
146
 
   ``path`` specifies the latest revision in another branch.
 
140
   ''path'' specifies the latest revision in another branch.
147
141
 
148
 
``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.
149
143
 
150
144
For example, to get the differences between this and another branch::
151
145