Rev 3902: (vila) Use the short status format when the short format is used for log in http://bazaar.launchpad.net/%7Evila/bzr/bzr.integration
Vincent Ladeuil
v.ladeuil+lp at free.fr
Fri Dec 12 12:14:44 GMT 2008
At http://bazaar.launchpad.net/%7Evila/bzr/bzr.integration
------------------------------------------------------------
revno: 3902
revision-id: v.ladeuil+lp at free.fr-20081212121401-fx3zk2ixgjz843k0
parent: pqm at pqm.ubuntu.com-20081212070030-93xnzs7f14962hti
parent: v.ladeuil+lp at free.fr-20081212120801-p1up3amo9ff3rghy
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: bzr.integration
timestamp: Fri 2008-12-12 13:14:01 +0100
message:
(vila) Use the short status format when the short format is used for log
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/delta.py delta.py-20050729221636-54cf14ef94783d0a
bzrlib/log.py log.py-20050505065812-c40ce11702fe5fb1
bzrlib/tests/blackbox/test_log.py test_log.py-20060112090212-78f6ea560c868e24
------------------------------------------------------------
revno: 3874.1.8
revision-id: v.ladeuil+lp at free.fr-20081212120801-p1up3amo9ff3rghy
parent: v.ladeuil+lp at free.fr-20081211071228-21705lekcnoam79u
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: log-s-v
timestamp: Fri 2008-12-12 13:08:01 +0100
message:
Fixed as ber Robert's review.
* bzrlib/tests/blackbox/test_log.py:
(TestLogVerbose): Refactor 'lob -v' delta format tests.
modified:
bzrlib/tests/blackbox/test_log.py test_log.py-20060112090212-78f6ea560c868e24
------------------------------------------------------------
revno: 3874.1.7
revision-id: v.ladeuil+lp at free.fr-20081211071228-21705lekcnoam79u
parent: v.ladeuil+lp at free.fr-20081210172141-tcdhvd9o14ingf1n
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: log-s-v
timestamp: Thu 2008-12-11 08:12:28 +0100
message:
Restrict '-v' change to log --short only.
* bzrlib/tests/blackbox/test_log.py:
(TestLog.test_log_long_verbose,
TestLog.test_log_long_verbose_verbose): Update tests to reflect
--long ignoring verbosity level.
* bzrlib/log.py:
(LongLogFormatter.log_revision): Ignore verbosity level to
preserve compatibility.
modified:
bzrlib/log.py log.py-20050505065812-c40ce11702fe5fb1
bzrlib/tests/blackbox/test_log.py test_log.py-20060112090212-78f6ea560c868e24
------------------------------------------------------------
revno: 3874.1.6
revision-id: v.ladeuil+lp at free.fr-20081210172141-tcdhvd9o14ingf1n
parent: v.ladeuil+lp at free.fr-20081209085733-x9ubc9uj33tddlhp
parent: v.ladeuil+lp at free.fr-20081210172011-hqo0uup8a7aq785f
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: log-s-v
timestamp: Wed 2008-12-10 18:21:41 +0100
message:
merge bzr.dev at 3890
added:
bzrlib/fifo_cache.py fifo_cache.py-20081209212307-31ffjwvteyvmydnf-1
bzrlib/tests/per_repository/test_add_inventory_by_delta.py test_add_inventory_d-20081013002626-rut81igtlqb4590z-1
bzrlib/tests/test_fifo_cache.py test_fifo_cache.py-20081209212307-31ffjwvteyvmydnf-2
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/__init__.py __init__.py-20050309040759-33e65acf91bbcd5d
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/commit.py commit.py-20050511101309-79ec1a0168e0e825
bzrlib/inventory.py inventory.py-20050309040759-6648b84ca2005b37
bzrlib/lru_cache.py lru_cache.py-20070119165515-tlw203kuwh0id5gv-1
bzrlib/remote.py remote.py-20060720103555-yeeg2x51vn0rbtdp-1
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/tests/__init__.py selftest.py-20050531073622-8d0e3c8845c97a64
bzrlib/tests/blackbox/test_ls.py test_ls.py-20060712232047-0jraqpecwngee12y-1
bzrlib/tests/blackbox/test_pull.py test_pull.py-20051201144907-64959364f629947f
bzrlib/tests/blackbox/test_revision_info.py test_revision_info.py-20050917162600-21dab3877aa348d7
bzrlib/tests/interrepository_implementations/__init__.py __init__.py-20060220054744-baf49a1f88f17b1a
bzrlib/tests/per_repository/__init__.py __init__.py-20060131092037-9564957a7d4a841b
bzrlib/tests/per_repository/test_commit_builder.py test_commit_builder.py-20060606110838-76e3ra5slucqus81-1
bzrlib/tests/per_repository/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
bzrlib/tests/test_lru_cache.py test_lru_cache.py-20070119165535-hph6rk4h9rzy4180-1
bzrlib/transport/__init__.py transport.py-20050711165921-4978aa7ce1285ad5
doc/developers/HACKING.txt HACKING-20050805200004-2a5dc975d870f78c
------------------------------------------------------------
revno: 3874.2.5
revision-id: v.ladeuil+lp at free.fr-20081210172011-hqo0uup8a7aq785f
parent: v.ladeuil+lp at free.fr-20081209085621-l1qyr2psspm72519
parent: pqm at pqm.ubuntu.com-20081210082822-li6ku9s3k63kjrpr
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: cleanups
timestamp: Wed 2008-12-10 18:20:11 +0100
message:
Merge bzr.dev into cleanups
added:
bzrlib/fifo_cache.py fifo_cache.py-20081209212307-31ffjwvteyvmydnf-1
bzrlib/tests/per_repository/test_add_inventory_by_delta.py test_add_inventory_d-20081013002626-rut81igtlqb4590z-1
bzrlib/tests/test_fifo_cache.py test_fifo_cache.py-20081209212307-31ffjwvteyvmydnf-2
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/__init__.py __init__.py-20050309040759-33e65acf91bbcd5d
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/commit.py commit.py-20050511101309-79ec1a0168e0e825
bzrlib/inventory.py inventory.py-20050309040759-6648b84ca2005b37
bzrlib/lru_cache.py lru_cache.py-20070119165515-tlw203kuwh0id5gv-1
bzrlib/remote.py remote.py-20060720103555-yeeg2x51vn0rbtdp-1
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/tests/__init__.py selftest.py-20050531073622-8d0e3c8845c97a64
bzrlib/tests/blackbox/test_ls.py test_ls.py-20060712232047-0jraqpecwngee12y-1
bzrlib/tests/blackbox/test_pull.py test_pull.py-20051201144907-64959364f629947f
bzrlib/tests/blackbox/test_revision_info.py test_revision_info.py-20050917162600-21dab3877aa348d7
bzrlib/tests/interrepository_implementations/__init__.py __init__.py-20060220054744-baf49a1f88f17b1a
bzrlib/tests/per_repository/__init__.py __init__.py-20060131092037-9564957a7d4a841b
bzrlib/tests/per_repository/test_commit_builder.py test_commit_builder.py-20060606110838-76e3ra5slucqus81-1
bzrlib/tests/per_repository/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
bzrlib/tests/test_lru_cache.py test_lru_cache.py-20070119165535-hph6rk4h9rzy4180-1
bzrlib/transport/__init__.py transport.py-20050711165921-4978aa7ce1285ad5
doc/developers/HACKING.txt HACKING-20050805200004-2a5dc975d870f78c
------------------------------------------------------------
revno: 3874.1.5
revision-id: v.ladeuil+lp at free.fr-20081209085733-x9ubc9uj33tddlhp
parent: v.ladeuil+lp at free.fr-20081205123515-q8d82ivuv6x36y7w
parent: v.ladeuil+lp at free.fr-20081209085621-l1qyr2psspm72519
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: log-s-v
timestamp: Tue 2008-12-09 09:57:33 +0100
message:
merge cleanups fixing conflicts
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/branch.py branch.py-20050309040759-e4baf4e0d046576e
bzrlib/bzrdir.py bzrdir.py-20060131065624-156dfea39c4387cb
bzrlib/fetch.py fetch.py-20050818234941-26fea6105696365d
bzrlib/knit.py knit.py-20051212171256-f056ac8f0fbe1bd9
bzrlib/log.py log.py-20050505065812-c40ce11702fe5fb1
bzrlib/registry.py lazy_factory.py-20060809213415-2gfvqadtvdn0phtg-1
bzrlib/remote.py remote.py-20060720103555-yeeg2x51vn0rbtdp-1
bzrlib/repofmt/pack_repo.py pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/revisionspec.py revisionspec.py-20050907152633-17567659fd5c0ddb
bzrlib/tests/blackbox/test_diff.py test_diff.py-20060110203741-aa99ac93e633d971
bzrlib/tests/branch_implementations/__init__.py __init__.py-20060123013057-b12a52c3f361daf4
bzrlib/tests/branch_implementations/test_branch.py testbranch.py-20050711070244-121d632bc37d7253
bzrlib/tests/branch_implementations/test_sprout.py test_sprout.py-20070521151739-b8t8p7axw1h966ws-1
bzrlib/tests/branch_implementations/test_stacking.py test_stacking.py-20080214020755-msjlkb7urobwly0f-1
bzrlib/tests/bzrdir_implementations/test_bzrdir.py test_bzrdir.py-20060131065642-0ebeca5e30e30866
bzrlib/tests/per_repository/test_add_fallback_repository.py test_add_fallback_re-20080215040003-8w9n4ck9uqdxj18m-1
bzrlib/tests/per_repository/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
bzrlib/tests/test_fetch.py testfetch.py-20050825090644-f73e07e7dfb1765a
bzrlib/tests/test_knit.py test_knit.py-20051212171302-95d4c00dd5f11f2b
bzrlib/tests/test_transport.py testtransport.py-20050718175618-e5cdb99f4555ddce
bzrlib/tests/test_versionedfile.py test_versionedfile.py-20060222045249-db45c9ed14a1c2e5
bzrlib/transport/__init__.py transport.py-20050711165921-4978aa7ce1285ad5
bzrlib/transport/remote.py ssh.py-20060608202016-c25gvf1ob7ypbus6-1
bzrlib/upgrade.py history2weaves.py-20050818063535-e7d319791c19a8b2
bzrlib/versionedfile.py versionedfile.py-20060222045106-5039c71ee3b65490
------------------------------------------------------------
revno: 3874.2.4
revision-id: v.ladeuil+lp at free.fr-20081209085621-l1qyr2psspm72519
parent: v.ladeuil+lp at free.fr-20081209085526-jvh9bayou0bcoo5l
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: cleanups
timestamp: Tue 2008-12-09 09:56:21 +0100
message:
Fix too long lines.
modified:
bzrlib/log.py log.py-20050505065812-c40ce11702fe5fb1
------------------------------------------------------------
revno: 3874.2.3
revision-id: v.ladeuil+lp at free.fr-20081209085526-jvh9bayou0bcoo5l
parent: v.ladeuil+lp at free.fr-20081205095113-u39p9ormkmt1w4v1
parent: pqm at pqm.ubuntu.com-20081209023452-12dbzcwzxrt1xee3
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: cleanups
timestamp: Tue 2008-12-09 09:55:26 +0100
message:
merge bzr.dev at 3883
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/branch.py branch.py-20050309040759-e4baf4e0d046576e
bzrlib/bzrdir.py bzrdir.py-20060131065624-156dfea39c4387cb
bzrlib/fetch.py fetch.py-20050818234941-26fea6105696365d
bzrlib/knit.py knit.py-20051212171256-f056ac8f0fbe1bd9
bzrlib/registry.py lazy_factory.py-20060809213415-2gfvqadtvdn0phtg-1
bzrlib/remote.py remote.py-20060720103555-yeeg2x51vn0rbtdp-1
bzrlib/repofmt/pack_repo.py pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/revisionspec.py revisionspec.py-20050907152633-17567659fd5c0ddb
bzrlib/tests/blackbox/test_diff.py test_diff.py-20060110203741-aa99ac93e633d971
bzrlib/tests/branch_implementations/__init__.py __init__.py-20060123013057-b12a52c3f361daf4
bzrlib/tests/branch_implementations/test_branch.py testbranch.py-20050711070244-121d632bc37d7253
bzrlib/tests/branch_implementations/test_sprout.py test_sprout.py-20070521151739-b8t8p7axw1h966ws-1
bzrlib/tests/branch_implementations/test_stacking.py test_stacking.py-20080214020755-msjlkb7urobwly0f-1
bzrlib/tests/bzrdir_implementations/test_bzrdir.py test_bzrdir.py-20060131065642-0ebeca5e30e30866
bzrlib/tests/per_repository/test_add_fallback_repository.py test_add_fallback_re-20080215040003-8w9n4ck9uqdxj18m-1
bzrlib/tests/per_repository/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
bzrlib/tests/test_fetch.py testfetch.py-20050825090644-f73e07e7dfb1765a
bzrlib/tests/test_knit.py test_knit.py-20051212171302-95d4c00dd5f11f2b
bzrlib/tests/test_transport.py testtransport.py-20050718175618-e5cdb99f4555ddce
bzrlib/tests/test_versionedfile.py test_versionedfile.py-20060222045249-db45c9ed14a1c2e5
bzrlib/transport/__init__.py transport.py-20050711165921-4978aa7ce1285ad5
bzrlib/transport/remote.py ssh.py-20060608202016-c25gvf1ob7ypbus6-1
bzrlib/upgrade.py history2weaves.py-20050818063535-e7d319791c19a8b2
bzrlib/versionedfile.py versionedfile.py-20060222045106-5039c71ee3b65490
------------------------------------------------------------
revno: 3874.1.4
revision-id: v.ladeuil+lp at free.fr-20081205123515-q8d82ivuv6x36y7w
parent: v.ladeuil+lp at free.fr-20081205095210-um1v5wvo0pib6mmj
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: log-s-v
timestamp: Fri 2008-12-05 13:35:15 +0100
message:
Fixed as per Aarons' comment.
* bzrlib/tests/blackbox/test_log.py:
(TestLog): Add more tests for 'delta_format'.
* bzrlib/log.py:
(LogFormatter): Document the 'delta_format' attribute.
(LogFormatter.__init__): Initialize 'delta_format' respecting
bzckward compatibility.
(LongLogFormatter.log_revision): Takes 'delta_format' into account.
(ShortLogFormatter.log_revision): Takes 'delta_format' into account.
* bzrlib/builtins.py:
(cmd_log.run): Use get_verbosity_level() to distinguish between -v
and -vv.
modified:
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/log.py log.py-20050505065812-c40ce11702fe5fb1
bzrlib/tests/blackbox/test_log.py test_log.py-20060112090212-78f6ea560c868e24
------------------------------------------------------------
revno: 3874.1.3
revision-id: v.ladeuil+lp at free.fr-20081205095210-um1v5wvo0pib6mmj
parent: v.ladeuil+lp at free.fr-20081201165324-w1go7lxnckpknk3k
parent: v.ladeuil+lp at free.fr-20081205095113-u39p9ormkmt1w4v1
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: log-s-v
timestamp: Fri 2008-12-05 10:52:10 +0100
message:
Merge cleanups into log-s-v
modified:
bzrlib/log.py log.py-20050505065812-c40ce11702fe5fb1
------------------------------------------------------------
revno: 3874.2.2
revision-id: v.ladeuil+lp at free.fr-20081205095113-u39p9ormkmt1w4v1
parent: v.ladeuil+lp at free.fr-20081201165155-awy16we83y95gahp
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: cleanups
timestamp: Fri 2008-12-05 10:51:13 +0100
message:
Cleanup show_log doc string.
* bzrlib/log.py:
(show_log): Reformat doc string.
modified:
bzrlib/log.py log.py-20050505065812-c40ce11702fe5fb1
------------------------------------------------------------
revno: 3874.1.2
revision-id: v.ladeuil+lp at free.fr-20081201165324-w1go7lxnckpknk3k
parent: v.ladeuil+lp at free.fr-20081201154814-9ukqbu07oj70booe
parent: v.ladeuil+lp at free.fr-20081201165155-awy16we83y95gahp
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: log-s-v
timestamp: Mon 2008-12-01 17:53:24 +0100
message:
Merge cleanups into log-s-v
modified:
bzrlib/delta.py delta.py-20050729221636-54cf14ef94783d0a
------------------------------------------------------------
revno: 3874.2.1
revision-id: v.ladeuil+lp at free.fr-20081201165155-awy16we83y95gahp
parent: pqm at pqm.ubuntu.com-20081201071425-al48chdg4wlkbm31
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: cleanups
timestamp: Mon 2008-12-01 17:51:55 +0100
message:
Empty lines.
modified:
bzrlib/delta.py delta.py-20050729221636-54cf14ef94783d0a
------------------------------------------------------------
revno: 3874.1.1
revision-id: v.ladeuil+lp at free.fr-20081201154814-9ukqbu07oj70booe
parent: pqm at pqm.ubuntu.com-20081201071425-al48chdg4wlkbm31
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: log-s-v
timestamp: Mon 2008-12-01 16:48:14 +0100
message:
Fix #87179 by using the short status format when the short format is used for log.
* bzrlib/tests/blackbox/test_log.py:
(TestLog.test_log_short_verbose): Test that we use the right
status format.
* bzrlib/log.py:
(ShortLogFormatter.log_revision): Set short_status to True.
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/log.py log.py-20050505065812-c40ce11702fe5fb1
bzrlib/tests/blackbox/test_log.py test_log.py-20060112090212-78f6ea560c868e24
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS 2008-12-12 03:53:56 +0000
+++ b/NEWS 2008-12-12 12:14:01 +0000
@@ -54,6 +54,9 @@
* ``pull -v`` now respects the log_format configuration variable.
(Aaron Bentley)
+ * Use the short status format when the short format is used for log.
+ (Vincent Ladeuil, #87179)
+
DOCUMENTATION:
API CHANGES:
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py 2008-12-11 06:03:57 +0000
+++ b/bzrlib/builtins.py 2008-12-12 12:14:01 +0000
@@ -56,7 +56,7 @@
from bzrlib.commands import Command, display_command
from bzrlib.option import ListOption, Option, RegistryOption, custom_help
-from bzrlib.trace import mutter, note, warning, is_quiet
+from bzrlib.trace import mutter, note, warning, is_quiet, get_verbosity_level
def tree_files(file_list, default_branch=u'.'):
@@ -1871,7 +1871,8 @@
log_format = log.log_formatter_registry.get_default(b)
lf = log_format(show_ids=show_ids, to_file=self.outf,
- show_timezone=timezone)
+ show_timezone=timezone,
+ delta_format=get_verbosity_level())
show_log(b,
lf,
=== modified file 'bzrlib/delta.py'
--- a/bzrlib/delta.py 2008-09-15 03:23:53 +0000
+++ b/bzrlib/delta.py 2008-12-01 16:51:55 +0000
@@ -104,7 +104,7 @@
if v[1] == file_id:
return True
return False
-
+
def show(self, to_file, show_ids=False, show_unchanged=False,
short_status=False, indent=''):
@@ -126,14 +126,14 @@
path, fid))
else:
to_file.write(indent + '%s %s\n' % (short_status_letter, path))
-
+
if self.removed:
if not short_status:
to_file.write(indent + 'removed:\n')
show_list(self.removed)
else:
show_list(self.removed, 'D')
-
+
if self.added:
if not short_status:
to_file.write(indent + 'added:\n')
=== modified file 'bzrlib/log.py'
--- a/bzrlib/log.py 2008-11-27 03:18:40 +0000
+++ b/bzrlib/log.py 2008-12-11 07:12:28 +0000
@@ -147,31 +147,25 @@
limit=None):
"""Write out human-readable log of commits to this branch.
- lf
- LogFormatter object to show the output.
-
- specific_fileid
- If true, list only the commits affecting the specified
- file, rather than all commits.
-
- verbose
- If true show added/changed/deleted/renamed files.
-
- direction
- 'reverse' (default) is latest to earliest;
- 'forward' is earliest to latest.
-
- start_revision
- If not None, only show revisions >= start_revision
-
- end_revision
- If not None, only show revisions <= end_revision
-
- search
- If not None, only show revisions with matching commit messages
-
- limit
- If not None or 0, only show limit revisions
+ :param lf: The LogFormatter object showing the output.
+
+ :param specific_fileid: If not None, list only the commits affecting the
+ specified file, rather than all commits.
+
+ :param verbose: If True show added/changed/deleted/renamed files.
+
+ :param direction: 'reverse' (default) is latest to earliest; 'forward' is
+ earliest to latest.
+
+ :param start_revision: If not None, only show revisions >= start_revision
+
+ :param end_revision: If not None, only show revisions <= end_revision
+
+ :param search: If not None, only show revisions with matching commit
+ messages
+
+ :param limit: If set, shows only 'limit' revisions, all revisions are shown
+ if None or 0.
"""
branch.lock_read()
try:
@@ -398,7 +392,8 @@
:param search: A user text search string.
:param log_rev_iterator: An input iterator containing all revisions that
could be displayed, in lists.
- :return: An iterator over lists of ((rev_id, revno, merge_depth), rev, delta).
+ :return: An iterator over lists of ((rev_id, revno, merge_depth), rev,
+ delta).
"""
repository = branch.repository
num = 9
@@ -649,7 +644,8 @@
elif direction != 'reverse':
raise ValueError('invalid direction %r' % direction)
- for sequence, rev_id, merge_depth, revno, end_of_merge in merge_sorted_revisions:
+ for (sequence, rev_id, merge_depth, revno, end_of_merge
+ ) in merge_sorted_revisions:
yield rev_id, '.'.join(map(str, revno)), merge_depth
@@ -713,7 +709,10 @@
to indicate which LogRevision attributes it supports:
- supports_delta must be True if this log formatter supports delta.
- Otherwise the delta attribute may not be populated.
+ Otherwise the delta attribute may not be populated. The 'delta_format'
+ attribute describes whether the 'short_status' format (1) or the long
+ one (2) sould be used.
+
- supports_merge_revisions must be True if this log formatter supports
merge revisions. If not, and if supports_single_merge_revisions is
also not True, then only mainline revisions will be passed to the
@@ -732,10 +731,15 @@
# to be shown
"""
- def __init__(self, to_file, show_ids=False, show_timezone='original'):
+ def __init__(self, to_file, show_ids=False, show_timezone='original',
+ delta_format=None):
self.to_file = to_file
self.show_ids = show_ids
self.show_timezone = show_timezone
+ if delta_format is None:
+ # Ensures backward compatibility
+ delta_format = 2 # long format
+ self.delta_format = delta_format
# TODO: uncomment this block after show() has been removed.
# Until then defining log_revision would prevent _show_log calling show()
@@ -813,7 +817,9 @@
for l in message.split('\n'):
to_file.write(indent + ' %s\n' % (l,))
if revision.delta is not None:
- revision.delta.show(to_file, self.show_ids, indent=indent)
+ # We don't respect delta_format for compatibility
+ revision.delta.show(to_file, self.show_ids, indent=indent,
+ short_status=False)
class ShortLogFormatter(LogFormatter):
@@ -834,7 +840,8 @@
show_offset=False),
is_merge))
if self.show_ids:
- to_file.write(' revision-id:%s\n' % (revision.rev.revision_id,))
+ to_file.write(' revision-id:%s\n'
+ % (revision.rev.revision_id,))
if not revision.rev.message:
to_file.write(' (no message)\n')
else:
@@ -842,10 +849,9 @@
for l in message.split('\n'):
to_file.write(' %s\n' % (l,))
- # TODO: Why not show the modified files in a shorter form as
- # well? rewrap them single lines of appropriate length
if revision.delta is not None:
- revision.delta.show(to_file, self.show_ids)
+ revision.delta.show(to_file, self.show_ids,
+ short_status=self.delta_format==1)
to_file.write('\n')
=== modified file 'bzrlib/tests/blackbox/test_log.py'
--- a/bzrlib/tests/blackbox/test_log.py 2008-12-04 19:59:34 +0000
+++ b/bzrlib/tests/blackbox/test_log.py 2008-12-12 12:14:01 +0000
@@ -244,6 +244,44 @@
self.assertContainsRe(log, r'revno: 3\n')
+class TestLogVerbose(TestCaseWithTransport):
+
+ def setUp(self):
+ super(TestLogVerbose, self).setUp()
+ tree = self.make_branch_and_tree('.')
+ self.build_tree(['hello.txt'])
+ tree.add('hello.txt')
+ tree.commit(message='message1')
+
+ def assertUseShortDeltaFormat(self, cmd):
+ log = self.run_bzr(cmd)[0]
+ # Check that we use the short status format
+ self.assertContainsRe(log, '(?m)^A hello.txt$')
+ self.assertNotContainsRe(log, '(?m)^added:$')
+
+ def assertUseLongDeltaFormat(self, cmd):
+ log = self.run_bzr(cmd)[0]
+ # Check that we use the long status format
+ self.assertNotContainsRe(log, '(?m)^A hello.txt$')
+ self.assertContainsRe(log, '(?m)^added:$')
+
+ def test_log_short_verbose(self):
+ self.assertUseShortDeltaFormat(['log', '--short', '-v'])
+
+ def test_log_short_verbose_verbose(self):
+ self.assertUseLongDeltaFormat(['log', '--short', '-vv'])
+
+ def test_log_long_verbose(self):
+ # Check that we use the long status format, ignoring the verbosity
+ # level
+ self.assertUseLongDeltaFormat(['log', '--long', '-v'])
+
+ def test_log_long_verbose_verbose(self):
+ # Check that we use the long status format, ignoring the verbosity
+ # level
+ self.assertUseLongDeltaFormat(['log', '--long', '-vv'])
+
+
class TestLogMerges(TestCaseWithoutPropsHandler):
def _prepare(self):
More information about the bazaar-commits
mailing list