7
The ``bzr log`` command shows a list of previous revisions.
9
As with ``bzr diff``, ``bzr log`` supports the ``-r`` argument::
11
% bzr log -r 1000.. # Revision 1000 and everything after it
12
% bzr log -r ..1000 # Everything up to and including r1000
13
% bzr log -r 1000..1100 # changes from 1000 to 1100
14
% bzr log -r 1000 # The changes in only revision 1000
19
As distributed VCS tools like Bazaar make merging much easier than
20
it is in central VCS tools, the history of a branch may often show
21
lines of development splitting off the mainline and merging back
22
in at a later time. Technically, the relationship between the
23
numerous revision nodes is known as a Directed Acyclic Graph or
26
In many cases though, you may only be interested in seeing the *mainline*
27
for a brach, namely the primary line of development within the DAG.
28
To do this, use the following command::
32
If you do this commonly, you may even wish to create an alias for it
33
as explained in `Using aliases`_.
38
The ``log`` command has several options that are useful for tuning
39
the output. These include:
41
* ``--forward`` presents the log in chronological order, i.e. the
42
most recent revisions are displayed last.
44
* the ``--limit`` option controls the maximum number of revisions displayed.
46
See the online help for the log command or the User Reference for more
47
information on tuning the output.
49
Viewing the history for a file
50
------------------------------
52
It is often useful to filter the history so that it only
53
applies to a given file. To do this, provide the filename
54
to the ``log`` command like this::
58
Viewing an old version of a file
59
--------------------------------
61
To get the contents of a file at a given version, use the
62
``cat`` command like this::
66
where ``X`` is the revision identifier and ``file`` is
67
the filename. This will send output to the standard output
68
stream so you'll typically want to pipe the output through
69
a viewing tool (like ``less`` or ``more``) or redirect it
72
bzr cat -r -2 foo.py | less
73
bzr car -r 1 foo.py > /tmp/foo-1st-version.py
75
Graphical history viewers
76
-------------------------
78
History browsing is one area where GUI tools really make life easier.
79
Bazaar has numerous plug-ins that provide this capability including
80
QBzr and bzr-gtk. See `Using plugins`_ for details on how to install
81
these if they are not already installed.
83
To use the graphical viewer from QBzr::
87
To use the graphical viewer from bzr-gtk::
91
``viz`` is actually a built-in alias for ``visualize`` so use the longer
92
command name if you prefer.