/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/workingtree.py

  • Committer: Vincent Ladeuil
  • Date: 2010-07-07 11:21:19 UTC
  • mto: (5193.7.1 unify-confs)
  • mto: This revision was merged to the branch mainline in revision 5349.
  • Revision ID: v.ladeuil+lp@free.fr-20100707112119-jwyh312df41w6l0o
Revert previous change as I can't reproduce the related problem anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
    revisiontree,
62
62
    trace,
63
63
    transform,
 
64
    transport,
64
65
    ui,
65
66
    views,
66
67
    xml5,
67
68
    xml7,
68
69
    )
69
 
import bzrlib.branch
70
 
from bzrlib.transport import get_transport
71
70
from bzrlib.workingtree_4 import (
72
71
    WorkingTreeFormat4,
73
72
    WorkingTreeFormat5,
369
368
                return True, None
370
369
            else:
371
370
                return True, tree
372
 
        transport = get_transport(location)
373
 
        iterator = bzrdir.BzrDir.find_bzrdirs(transport, evaluate=evaluate,
 
371
        t = transport.get_transport(location)
 
372
        iterator = bzrdir.BzrDir.find_bzrdirs(t, evaluate=evaluate,
374
373
                                              list_current=list_current)
375
 
        return [t for t in iterator if t is not None]
 
374
        return [tr for tr in iterator if tr is not None]
376
375
 
377
376
    # should be deprecated - this is slow and in any case treating them as a
378
377
    # container is (we now know) bad style -- mbp 20070302
463
462
        return (file_obj, stat_value)
464
463
 
465
464
    def get_file_text(self, file_id, path=None, filtered=True):
466
 
        return self.get_file(file_id, path=path, filtered=filtered).read()
 
465
        my_file = self.get_file(file_id, path=path, filtered=filtered)
 
466
        try:
 
467
            return my_file.read()
 
468
        finally:
 
469
            my_file.close()
467
470
 
468
471
    def get_file_byname(self, filename, filtered=True):
469
472
        path = self.abspath(filename)
523
526
 
524
527
        # Now we have the parents of this content
525
528
        annotator = self.branch.repository.texts.get_annotator()
526
 
        text = self.get_file(file_id).read()
 
529
        text = self.get_file_text(file_id)
527
530
        this_key =(file_id, default_revision)
528
531
        annotator.add_special_text(this_key, file_parent_keys, text)
529
532
        annotations = [(key[-1], line)