Description: Avoid direct access to inventories (deprecated in bzr 2.6).
Origin: commit, revision id: jelmer@samba.org-20120221100557-dqfwsv5vej9g2l2x
Author: Jelmer Vernooij <jelmer@samba.org>
Last-Update: 2012-02-21
Applied-Upstream: no
X-Bzr-Revision-Id: jelmer@samba.org-20120221100557-dqfwsv5vej9g2l2x

=== modified file 'cmds.py'
--- old/cmds.py	2011-12-12 15:11:38 +0000
+++ new/cmds.py	2012-02-21 10:05:57 +0000
@@ -163,7 +163,7 @@
             if file_id is None:
                 raise bzrlib.errors.NotVersionedError(filename)
 
-            file_version = tree.inventory[file_id].revision
+            file_version = tree.get_file_revision(file_id)
             # always run with --all and --long options
             # to get the author of each line
             annotate_file_xml(branch=branch, rev_id=file_version,

=== modified file 'infoxml.py'
--- old/infoxml.py	2011-12-12 15:11:38 +0000
+++ new/infoxml.py	2012-02-21 10:05:57 +0000
@@ -216,7 +216,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]
@@ -233,7 +232,6 @@
 def _show_working_stats_xml(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('<working_tree_stats>')
@@ -254,9 +252,8 @@
     outfile.write('<ignored>%d</ignored>' % 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)):
+    for path, entry in working.iter_entries_by_dir():
+        if entry.kind == 'directory' and entry.parent_id is not None:
             dir_cnt += 1
     outfile.write('<versioned_subdirectories>%d</versioned_subdirectories>' %
                  (dir_cnt))

