/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 breezy/tests/test_bundle.py

  • Committer: Jelmer Vernooij
  • Date: 2018-10-30 02:36:00 UTC
  • mto: This revision was merged to the branch mainline in revision 7170.
  • Revision ID: jelmer@jelmer.uk-20181030023600-akhcvlhwce4bcij1
Fix some bundle tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
 
64
64
def get_inventory_text(repo, revision_id):
65
65
    """Get the fulltext for the inventory at revision id"""
66
 
    repo.lock_read()
67
 
    try:
 
66
    with repo.lock_read():
68
67
        return get_text(repo.inventories, (revision_id,))
69
 
    finally:
70
 
        repo.unlock()
71
68
 
72
69
 
73
70
class MockTree(object):
102
99
        else:
103
100
            return self.make_entry(file_id, self.paths[file_id])
104
101
 
 
102
    def get_entry_by_path(self, path):
 
103
        return self[self.path2id(path)]
 
104
 
105
105
    def parent_id(self, file_id):
106
106
        parent_dir = os.path.dirname(self.paths[file_id])
107
107
        if parent_dir == "":
125
125
        if not isinstance(file_id, bytes):
126
126
            raise TypeError(file_id)
127
127
        name = os.path.basename(path)
128
 
        kind = self.kind(path, file_id)
 
128
        kind = self.kind(path)
129
129
        parent_id = self.parent_id(file_id)
130
 
        text_sha_1, text_size = self.contents_stats(path, file_id)
 
130
        text_sha_1, text_size = self.contents_stats(path)
131
131
        if kind == 'directory':
132
132
            ie = InventoryDirectory(file_id, name, parent_id)
133
133
        elif kind == 'file':