Rev 5793: (jelmer) Avoid using working tree inventories in "bzr info". Rather, in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Sun Apr 17 15:56:56 UTC 2011
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 5793 [merge]
revision-id: pqm at pqm.ubuntu.com-20110417155651-sn5otvkvpofcsi18
parent: pqm at pqm.ubuntu.com-20110416151149-qlsm8s7wy37mw3kx
parent: jelmer at samba.org-20110417095736-vgve88ugvygx3b5m
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Sun 2011-04-17 15:56:51 +0000
message:
(jelmer) Avoid using working tree inventories in "bzr info". Rather,
use the standard tree API. (Jelmer Vernooij)
modified:
bzrlib/info.py info.py-20050323235939-6bbfe7d9700b0b9b
=== modified file 'bzrlib/info.py'
--- a/bzrlib/info.py 2011-03-30 11:45:54 +0000
+++ b/bzrlib/info.py 2011-04-17 09:57:36 +0000
@@ -221,7 +221,6 @@
"""Show missing revisions in working tree."""
branch = working.branch
basis = working.basis_tree()
- work_inv = working.inventory
branch_revno, branch_last_revision = branch.last_revision_info()
try:
tree_last_id = working.get_parent_ids()[0]
@@ -239,7 +238,6 @@
def _show_working_stats(working, outfile):
"""Show statistics about a working tree."""
basis = working.basis_tree()
- work_inv = working.inventory
delta = working.changes_from(basis, want_unchanged=True)
outfile.write('\n')
@@ -260,9 +258,9 @@
outfile.write(' %8d ignored\n' % ignore_cnt)
dir_cnt = 0
- for file_id in work_inv:
- if (work_inv.get_file_kind(file_id) == 'directory' and
- not work_inv.is_root(file_id)):
+ root_id = working.get_root_id()
+ for path, entry in working.iter_entries_by_dir():
+ if entry.kind == 'directory' and entry.file_id != root_id:
dir_cnt += 1
outfile.write(' %8d versioned %s\n' % (dir_cnt,
plural(dir_cnt, 'subdirectory', 'subdirectories')))
More information about the bazaar-commits
mailing list