/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/repository_implementations/test_commit_builder.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-10-03 05:04:42 UTC
  • mfrom: (2776.4.19 commit)
  • Revision ID: pqm@pqm.ubuntu.com-20071003050442-e0x9ofdfo0hwxnal
(robertc) Move serialisation of inventory entries into CommitBuilder. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
                tree.unlock()
52
52
            parent_tree = tree.branch.repository.revision_tree(None)
53
53
            parent_invs = []
54
 
            builder.record_entry_contents(ie, parent_invs, '', tree)
 
54
            builder.record_entry_contents(ie, parent_invs, '', tree,
 
55
                tree.path_content_summary(''))
55
56
 
56
57
    def test_finish_inventory(self):
57
58
        tree = self.make_branch_and_tree(".")
133
134
            builder = tree.branch.get_commit_builder([])
134
135
            self.callDeprecated(['Root entry should be supplied to'
135
136
                ' record_entry_contents, as of bzr 0.10.'],
136
 
                builder.record_entry_contents, entry, [], 'foo', tree)
 
137
                builder.record_entry_contents, entry, [], 'foo', tree,
 
138
                    tree.path_content_summary('foo'))
137
139
            builder.finish_inventory()
138
140
            rev_id = builder.commit('foo bar')
139
141
        finally:
151
153
            ie = inventory.make_entry('directory', '', None,
152
154
                    tree.inventory.root.file_id)
153
155
            self.assertFalse(builder.record_entry_contents(
154
 
                ie, [parent_tree.inventory], '', tree))
 
156
                ie, [parent_tree.inventory], '', tree,
 
157
                tree.path_content_summary('')))
155
158
            builder.abort()
156
159
        except:
157
160
            builder.abort()
332
335
            # root
333
336
            builder.record_entry_contents(
334
337
                inventory.make_entry('directory', '', None,
335
 
                    tree.inventory.root.file_id), parent_invs, '', tree)
 
338
                    tree.inventory.root.file_id), parent_invs, '', tree,
 
339
                    tree.path_content_summary(''))
336
340
            def commit_id(file_id):
337
341
                old_ie = tree.inventory[file_id]
338
342
                path = tree.id2path(file_id)
339
343
                ie = inventory.make_entry(tree.kind(file_id), old_ie.name,
340
344
                    old_ie.parent_id, file_id)
341
 
                return builder.record_entry_contents(ie, parent_invs, path, tree)
 
345
                return builder.record_entry_contents(ie, parent_invs, path,
 
346
                    tree, tree.path_content_summary(path))
342
347
 
343
348
            file_id = name + 'id'
344
349
            parent_id = tree.inventory[file_id].parent_id