~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

Merge cleanup into first-try

Show diffs side-by-side

added added

removed removed

Lines of Context:
2873
2873
            self.revisions[rev_id] = rev
2874
2874
 
2875
2875
    def _load_old_inventory(self, rev_id):
2876
 
        old_inv_xml = self.branch.repository.inventory_store.get(rev_id).read()
 
2876
        f = self.branch.repository.inventory_store.get(rev_id)
 
2877
        try:
 
2878
            old_inv_xml = f.read()
 
2879
        finally:
 
2880
            f.close()
2877
2881
        inv = xml4.serializer_v4.read_inventory_from_string(old_inv_xml)
2878
2882
        inv.revision_id = rev_id
2879
2883
        rev = self.revisions[rev_id]
2957
2961
                ie.revision = previous_ie.revision
2958
2962
                return
2959
2963
        if ie.has_text():
2960
 
            text = self.branch.repository._text_store.get(ie.text_id)
2961
 
            file_lines = text.readlines()
 
2964
            f = self.branch.repository._text_store.get(ie.text_id)
 
2965
            try:
 
2966
                file_lines = f.readlines()
 
2967
            finally:
 
2968
                f.close()
2962
2969
            w.add_lines(rev_id, previous_revisions, file_lines)
2963
2970
            self.text_count += 1
2964
2971
        else: