~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-01-12 09:05:11 UTC
  • mfrom: (4948.4.1 cat-objectnotlocked)
  • Revision ID: pqm@pqm.ubuntu.com-20100112090511-hcet612qmzmxnqey
(andrew) Fix ObjectNotLocked error in 'bzr cat -rbranch:... FILE'.
        (#506274)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2820
2820
        if tree is None:
2821
2821
            tree = b.basis_tree()
2822
2822
        rev_tree = _get_one_revision_tree('cat', revision, branch=b)
 
2823
        rev_tree.lock_read()
 
2824
        self.add_cleanup(rev_tree.unlock)
2823
2825
 
2824
2826
        old_file_id = rev_tree.path2id(relpath)
2825
2827
 
2860
2862
            chunks = content.splitlines(True)
2861
2863
            content = filtered_output_bytes(chunks, filters,
2862
2864
                ContentFilterContext(relpath, rev_tree))
 
2865
            self.cleanup_now()
2863
2866
            self.outf.writelines(content)
2864
2867
        else:
 
2868
            self.cleanup_now()
2865
2869
            self.outf.write(content)
2866
2870
 
2867
2871