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
16
Viewing merged revisions
17
------------------------
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 contain
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, you typically want to see the mainline first and drill
27
down from there. The default behaviour of log is therefore to show
28
the mainline and indicate which revisions have nested merged revisions.
29
To explore the merged revisions for revision X, use the following command::
33
To see all revisions and all their merged revisions::
37
Note that the -n option is used to indicate the number of levels to display
38
where 0 means all. If that is too noisy, you can easily adjust the number
39
to only view down so far. For example, if your project is structured with
40
a top level gatekeeper merging changes from team gatekeepers, ``bzr log``
41
shows what the top level gatekeeper did while ``bzr log -n2`` shows what
42
the team gatekeepers did. In the vast majority of cases though, ``-n0``
48
The ``log`` command has several options that are useful for tuning
49
the output. These include:
51
* ``--forward`` presents the log in chronological order, i.e. the
52
most recent revisions are displayed last.
54
* the ``--limit`` option controls the maximum number of revisions displayed.
56
See the online help for the log command or the User Reference for more
57
information on tuning the output.
59
Viewing the history for a file
60
------------------------------
62
It is often useful to filter the history so that it only
63
applies to a given file. To do this, provide the filename
64
to the ``log`` command like this::
68
Viewing an old version of a file
69
--------------------------------
71
To get the contents of a file at a given version, use the
72
``cat`` command like this::
76
where ``X`` is the revision identifier and ``file`` is
77
the filename. This will send output to the standard output
78
stream so you'll typically want to pipe the output through
79
a viewing tool (like ``less`` or ``more``) or redirect it
82
bzr cat -r -2 foo.py | less
83
bzr cat -r 1 foo.py > /tmp/foo-1st-version.py
85
Graphical history viewers
86
-------------------------
88
History browsing is one area where GUI tools really make life easier.
89
Bazaar has numerous plug-ins that provide this capability including
90
QBzr and bzr-gtk. See `Using plugins <plugins.html>`_ for details on how to install
91
these if they are not already installed.
93
To use the graphical viewer from QBzr::
97
To use the graphical viewer from bzr-gtk::
101
``viz`` is actually a built-in alias for ``visualize`` so use the longer
102
command name if you prefer.