/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: Andrew Bennetts
  • Date: 2008-10-27 06:14:45 UTC
  • mfrom: (3793 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3795.
  • Revision ID: andrew.bennetts@canonical.com-20081027061445-eqt9lz6uw1mbvq4g
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007, 2008 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
303
303
 
304
304
        """
305
305
        if path is None:
306
 
            path = os.path.getcwdu()
 
306
            path = osutils.getcwd()
307
307
        control = bzrdir.BzrDir.open(path, _unsupported)
308
308
        return control.open_workingtree(_unsupported)
309
 
        
 
309
 
310
310
    @staticmethod
311
311
    def open_containing(path=None):
312
312
        """Open an existing working tree which has its root about path.
313
 
        
 
313
 
314
314
        This probes for a working tree at path and searches upwards from there.
315
315
 
316
316
        Basically we keep looking up until we find the control directory or
424
424
        return osutils.lexists(self.abspath(filename))
425
425
 
426
426
    def get_file(self, file_id, path=None):
 
427
        return self.get_file_with_stat(file_id, path)[0]
 
428
 
 
429
    def get_file_with_stat(self, file_id, path=None, _fstat=os.fstat):
 
430
        """See MutableTree.get_file_with_stat."""
427
431
        if path is None:
428
432
            path = self.id2path(file_id)
429
 
        return self.get_file_byname(path)
 
433
        file_obj = self.get_file_byname(path)
 
434
        return (file_obj, _fstat(file_obj.fileno()))
430
435
 
431
436
    def get_file_text(self, file_id):
432
437
        return self.get_file(file_id).read()
2326
2331
                    # value.
2327
2332
                    bzrdir_loc = bisect_left(cur_disk_dir_content,
2328
2333
                        ('.bzr', '.bzr'))
2329
 
                    if cur_disk_dir_content[bzrdir_loc][0] == '.bzr':
 
2334
                    if (bzrdir_loc < len(cur_disk_dir_content)
 
2335
                        and cur_disk_dir_content[bzrdir_loc][0] == '.bzr'):
2330
2336
                        # we dont yield the contents of, or, .bzr itself.
2331
2337
                        del cur_disk_dir_content[bzrdir_loc]
2332
2338
            if inv_finished: