1228
1228
class cmd_update(Command):
1229
1229
"""Update a tree to have the latest code committed to its branch.
1231
1231
This will perform a merge into the working tree, and may generate
1232
conflicts. If you have any local changes, you will still
1232
conflicts. If you have any local changes, you will still
1233
1233
need to commit them after the update for the update to be complete.
1235
If you want to discard your local changes, you can just do a
1235
If you want to discard your local changes, you can just do a
1236
1236
'bzr revert' instead of 'bzr commit' after the update.
1744
1744
old_tree, new_tree, specific_files, extra_trees = \
1745
1745
_get_trees_to_diff(file_list, revision, old, new,
1746
1746
apply_view=True)
1747
return show_diff_trees(old_tree, new_tree, sys.stdout,
1747
return show_diff_trees(old_tree, new_tree, sys.stdout,
1748
1748
specific_files=specific_files,
1749
1749
external_diff_options=diff_options,
1750
1750
old_label=old_label, new_label=new_label,
1906
1906
The following options can be used to control what information is
1909
1909
-l N display a maximum of N revisions
1910
1910
-n N display N levels of revisions (0 for all, 1 for collapsed)
1911
1911
-v display a status summary (delta) for each revision
1912
1912
-p display a diff (patch) for each revision
1913
1913
--show-ids display revision-ids (and file-ids), not just revnos
1915
1915
Note that the default number of levels to display is a function of the
1916
1916
log format. If the -n option is not used, ``short`` and ``line`` show
1917
1917
just the top level (mainline) while ``long`` shows all levels of merged
1920
1920
Status summaries are shown using status flags like A, M, etc. To see
1921
1921
the changes explained using words like ``added`` and ``modified``
1922
1922
instead, use the -vv option.
1924
1924
:Ordering control:
1926
1926
To display revisions from oldest to newest, use the --forward option.
1927
1927
In most cases, using this option will have little impact on the total
1928
1928
time taken to produce a log, though --forward does not incrementally
1929
1929
display revisions like --reverse does when it can.
1931
1931
:Revision filtering:
1933
1933
The -r option can be used to specify what revision or range of revisions
1934
1934
to filter against. The various forms are shown below::
1936
1936
-rX display revision X
1937
1937
-rX.. display revision X and later
1938
1938
-r..Y display up to and including revision Y
1939
1939
-rX..Y display from X to Y inclusive
1941
1941
See ``bzr help revisionspec`` for details on how to specify X and Y.
1942
1942
Some common examples are given below::
1944
1944
-r-1 show just the tip
1945
1945
-r-10.. show the last 10 mainline revisions
1946
1946
-rsubmit:.. show what's new on this branch
1947
1947
-rancestor:path.. show changes since the common ancestor of this
1948
1948
branch and the one at location path
1949
1949
-rdate:yesterday.. show changes since yesterday
1951
1951
When logging a range of revisions using -rX..Y, log starts at
1952
1952
revision Y and searches back in history through the primary
1953
1953
("left-hand") parents until it finds X. When logging just the
1956
1956
a nested merge revision and the log will be truncated accordingly.
1958
1958
:Path filtering:
1960
1960
If a parameter is given and it's not a branch, the log will be filtered
1961
1961
to show only those revisions that changed the nominated file or
1964
1964
Filenames are interpreted within their historical context. To log a
1965
1965
deleted file, specify a revision range so that the file existed at
1966
1966
the end or start of the range.
1968
1968
Historical context is also important when interpreting pathnames of
1969
1969
renamed files/directories. Consider the following example:
1971
1971
* revision 1: add tutorial.txt
1972
1972
* revision 2: modify tutorial.txt
1973
1973
* revision 3: rename tutorial.txt to guide.txt; add tutorial.txt
1977
1977
* ``bzr log guide.txt`` will log the file added in revision 1
1979
1979
* ``bzr log tutorial.txt`` will log the new file added in revision 3
1981
1981
* ``bzr log -r2 -p tutorial.txt`` will show the changes made to
1982
1982
the original file in revision 2.
1984
1984
* ``bzr log -r2 -p guide.txt`` will display an error message as there
1985
1985
was no file called guide.txt in revision 2.
1987
1987
Renames are always followed by log. By design, there is no need to
1988
1988
explicitly ask for this (and no way to stop logging a file back
1989
1989
until it was last renamed).
1991
1991
Note: If the path is a directory, only revisions that directly changed
1992
1992
that directory object are currently shown. This is considered a bug.
1993
1993
(Support for filtering against multiple files and for files within a
1994
1994
directory is under development.)
1996
1996
:Other filtering:
1998
1998
The --message option can be used for finding revisions that match a
1999
1999
regular expression in a commit message.
2001
2001
:Tips & tricks:
2003
2003
GUI tools and IDEs are often better at exploring history than command
2004
2004
line tools. You may prefer qlog or glog from the QBzr and Bzr-Gtk packages
2005
2005
respectively for example. (TortoiseBzr uses qlog for displaying logs.) See
2006
2006
http://bazaar-vcs.org/BzrPlugins and http://bazaar-vcs.org/IDEIntegration.
2008
2008
Web interfaces are often better at exploring history than command line
2009
2009
tools, particularly for branches on servers. You may prefer Loggerhead
2010
2010
or one of its alternatives. See http://bazaar-vcs.org/WebInterface.
2012
2012
You may find it useful to add the aliases below to ``bazaar.conf``::
2015
2015
tip = log -r-1 -n1
2016
2016
top = log -r-10.. --short --forward
2017
2017
show = log -v -p -n1 --long
2019
2019
``bzr tip`` will then show the latest revision while ``bzr top``
2020
2020
will show the last 10 mainline revisions. To see the details of a
2021
2021
particular revision X, ``bzr show -rX``.
2023
2023
As many GUI tools and Web interfaces do, you may prefer viewing
2024
2024
history collapsed initially. If you are interested in looking deeper
2025
2025
into a particular merge X, use ``bzr log -n0 -rX``. If you like
2026
2026
working this way, you may wish to either:
2028
2028
* change your default log format to short (or line)
2029
2029
* add this alias: log = log -n1
2031
2031
``bzr log -v`` on a branch with lots of history is currently
2032
2032
very slow. A fix for this issue is currently under development.
2033
2033
With or without that fix, it is recommended that a revision range
2034
2034
be given when using the -v option.
2036
2036
bzr has a generic full-text matching plugin, bzr-search, that can be
2037
2037
used to find revisions matching user names, commit messages, etc.
2038
2038
Among other features, this plugin can find all revisions containing
2039
2039
a list of words but not others.
2041
2041
When exploring non-mainline history on large projects with deep
2042
2042
history, the performance of log can be greatly improved by installing
2043
2043
the revnocache plugin. This plugin buffers historical information
2388
2388
if not name_pattern_list:
2389
2389
raise errors.BzrCommandError("ignore requires at least one "
2390
2390
"NAME_PATTERN or --old-default-rules")
2391
name_pattern_list = [globbing.normalize_pattern(p)
2391
name_pattern_list = [globbing.normalize_pattern(p)
2392
2392
for p in name_pattern_list]
2393
2393
for name_pattern in name_pattern_list:
2394
if (name_pattern[0] == '/' or
2394
if (name_pattern[0] == '/' or
2395
2395
(len(name_pattern) > 1 and name_pattern[1] == ':')):
2396
2396
raise errors.BzrCommandError(
2397
2397
"NAME_PATTERN should not be an absolute path")
4019
4019
This prints out the given file with an annotation on the left side
4020
4020
indicating which revision, author and date introduced the change.
4022
If the origin is the same for a run of consecutive lines, it is
4022
If the origin is the same for a run of consecutive lines, it is
4023
4023
shown only at the top, unless the --all option is given.
4025
4025
# TODO: annotate directories; showing when each file was last changed
4026
# TODO: if the working copy is modified, show annotations on that
4026
# TODO: if the working copy is modified, show annotations on that
4027
4027
# with new uncommitted lines marked
4028
4028
aliases = ['ann', 'blame', 'praise']
4029
4029
takes_args = ['filename']
4652
4652
Mail is sent using your preferred mail program. This should be transparent
4653
4653
on Windows (it uses MAPI). On Linux, it requires the xdg-email utility.
4654
4654
If the preferred client can't be found (or used), your editor will be used.
4656
4656
To use a specific mail program, set the mail_client configuration option.
4657
4657
(For Thunderbird 1.5, this works around some bugs.) Supported values for
4658
4658
specific clients are "claws", "evolution", "kmail", "mutt", and