/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
2977.1.3 by Ian Clatworthy
1st cut at the 'Personal version control' chapter
1
Browsing history
2
================
3
6622.1.24 by Jelmer Vernooij
More doc renames.
4
brz log
2977.1.3 by Ian Clatworthy
1st cut at the 'Personal version control' chapter
5
-------
6
6622.1.24 by Jelmer Vernooij
More doc renames.
7
The ``brz log`` command shows a list of previous revisions.
8
9
As with ``brz diff``, ``brz log`` supports the ``-r`` argument::
10
11
    % brz log -r 1000..          # Revision 1000 and everything after it
12
    % brz log -r ..1000          # Everything up to and including r1000
13
    % brz log -r 1000..1100      # changes from 1000 to 1100
14
    % brz log -r 1000            # The changes in only revision 1000
2977.1.3 by Ian Clatworthy
1st cut at the 'Personal version control' chapter
15
4206.1.1 by Ian Clatworthy
log mainline by default
16
Viewing merged revisions
17
------------------------
2977.1.3 by Ian Clatworthy
1st cut at the 'Personal version control' chapter
18
6622.1.24 by Jelmer Vernooij
More doc renames.
19
As distributed VCS tools like Breezy make merging much easier than
4206.1.1 by Ian Clatworthy
log mainline by default
20
it is in central VCS tools, the history of a branch may often contain
2977.1.3 by Ian Clatworthy
1st cut at the 'Personal version control' chapter
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
24
DAG for short.
25
4206.1.1 by Ian Clatworthy
log mainline by default
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::
30
6622.1.24 by Jelmer Vernooij
More doc renames.
31
  brz log -n0 -rX
4206.1.1 by Ian Clatworthy
log mainline by default
32
33
To see all revisions and all their merged revisions::
34
6622.1.24 by Jelmer Vernooij
More doc renames.
35
  brz log -n0
4206.1.1 by Ian Clatworthy
log mainline by default
36
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
6622.1.24 by Jelmer Vernooij
More doc renames.
40
a top level gatekeeper merging changes from team gatekeepers, ``brz log``
41
shows what the top level gatekeeper did while ``brz log -n2`` shows what
4206.1.1 by Ian Clatworthy
log mainline by default
42
the team gatekeepers did. In the vast majority of cases though, ``-n0``
43
is fine.
2977.1.3 by Ian Clatworthy
1st cut at the 'Personal version control' chapter
44
45
Tuning the output
46
-----------------
47
48
The ``log`` command has several options that are useful for tuning
49
the output. These include:
50
51
 * ``--forward`` presents the log in chronological order, i.e. the
52
   most recent revisions are displayed last.
53
54
 * the ``--limit`` option controls the maximum number of revisions displayed.
55
56
See the online help for the log command or the User Reference for more
57
information on tuning the output.
58
59
Viewing the history for a file
60
------------------------------
61
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::
65
6622.1.24 by Jelmer Vernooij
More doc renames.
66
  brz log foo.py
2977.1.3 by Ian Clatworthy
1st cut at the 'Personal version control' chapter
67
68
Viewing an old version of a file
69
--------------------------------
70
71
To get the contents of a file at a given version, use the
72
``cat`` command like this::
73
6622.1.24 by Jelmer Vernooij
More doc renames.
74
  brz cat -r X file
2977.1.3 by Ian Clatworthy
1st cut at the 'Personal version control' chapter
75
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
80
like this::
81
6622.1.24 by Jelmer Vernooij
More doc renames.
82
  brz cat -r -2 foo.py | less
83
  brz cat -r 1 foo.py > /tmp/foo-1st-version.py
2977.1.3 by Ian Clatworthy
1st cut at the 'Personal version control' chapter
84
85
Graphical history viewers
86
-------------------------
87
88
History browsing is one area where GUI tools really make life easier.
6622.1.24 by Jelmer Vernooij
More doc renames.
89
Breezy has numerous plug-ins that provide this capability including
90
QBzr and brz-gtk. See `Using plugins <plugins.html>`_ for details on how to install
2977.1.3 by Ian Clatworthy
1st cut at the 'Personal version control' chapter
91
these if they are not already installed.
92
93
To use the graphical viewer from QBzr::
94
6622.1.24 by Jelmer Vernooij
More doc renames.
95
  brz qlog
96
97
To use the graphical viewer from brz-gtk::
98
99
  brz viz
2977.1.3 by Ian Clatworthy
1st cut at the 'Personal version control' chapter
100
101
``viz`` is actually a built-in alias for ``visualize`` so use the longer
102
command name if you prefer.
103