Merge lp:~jelmer/bzr-builddeb/no-tree-inventory into lp:bzr-builddeb

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Vincent Ladeuil
Approved revision: 716
Merged at revision: 715
Proposed branch: lp:~jelmer/bzr-builddeb/no-tree-inventory
Merge into: lp:bzr-builddeb
Diff against target: 67 lines (+12/-4)
4 files modified
bzrtools_import.py (+1/-1)
debian/changelog (+2/-1)
tests/blackbox/test_merge_upstream.py (+8/-1)
upstream/pristinetar.py (+1/-1)
To merge this branch: bzr merge lp:~jelmer/bzr-builddeb/no-tree-inventory
Reviewer Review Type Date Requested Status
Vincent Ladeuil Approve
Review via email: mp+93581@code.launchpad.net

Description of the change

Fix support for bzr.dev, where Tree.inventory is deprecated.

To post a comment you must log in.
716. By Jelmer Vernooij

Add bug #

Revision history for this message
Vincent Ladeuil (vila) wrote :

Faster than light...

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrtools_import.py'
2--- bzrtools_import.py 2011-10-24 16:35:29 +0000
3+++ bzrtools_import.py 2012-02-17 15:22:18 +0000
4@@ -227,7 +227,7 @@
5 tt = TreeTransform(tree)
6 try:
7 removed = set()
8- for path, entry in tree.inventory.iter_entries():
9+ for path, entry in tree.iter_entries_by_dir():
10 if entry.parent_id is None:
11 continue
12 trans_id = tt.trans_id_tree_path(path)
13
14=== modified file 'debian/changelog'
15--- debian/changelog 2012-02-01 12:21:15 +0000
16+++ debian/changelog 2012-02-17 15:22:18 +0000
17@@ -3,8 +3,9 @@
18 * Fix patch unapplying from DirStateRevisionTrees. LP: #923688
19 * Bump distro-info dependency back to a recommends, to ease
20 backporting.
21+ * Cope with the deprecation of Tree.inventory in bzr/2.6. LP: #934247
22
23- -- Jelmer Vernooij <jelmer@debian.org> Wed, 01 Feb 2012 13:20:49 +0100
24+ -- Jelmer Vernooij <jelmer@debian.org> Fri, 17 Feb 2012 15:38:41 +0100
25
26 bzr-builddeb (2.8.2) unstable; urgency=low
27
28
29=== modified file 'tests/blackbox/test_merge_upstream.py'
30--- tests/blackbox/test_merge_upstream.py 2011-11-10 15:56:26 +0000
31+++ tests/blackbox/test_merge_upstream.py 2012-02-17 15:22:18 +0000
32@@ -35,6 +35,13 @@
33 )
34
35
36+def iter_child_entries(tree, file_id):
37+ try:
38+ return tree.root_inventory.root.children.values()
39+ except AttributeError:
40+ return tree.inventory.root.children.values()
41+
42+
43 class Fixture(object):
44 """A test fixture."""
45
46@@ -121,7 +128,7 @@
47 tree.lock_write()
48 try:
49 newpath = test_case.getUniqueString()
50- for child in tree.inventory.root.children.values():
51+ for child in iter_child_entries(tree, tree.get_root_id()):
52 if child.kind == 'file':
53 oldpath = child.name
54 tree.rename_one(oldpath, newpath)
55
56=== modified file 'upstream/pristinetar.py'
57--- upstream/pristinetar.py 2012-01-19 11:30:35 +0000
58+++ upstream/pristinetar.py 2012-02-17 15:22:18 +0000
59@@ -404,7 +404,7 @@
60 dest = os.path.join(tmpdir, "orig")
61 tree.lock_read()
62 try:
63- for (dp, ie) in tree.inventory.iter_entries():
64+ for (dp, ie) in tree.iter_entries_by_dir():
65 ie._read_tree_state(dp, tree)
66 export(tree, dest, format='dir', subdir=subdir)
67 finally:

Subscribers

People subscribed via source and target branches