~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
    bzrdir,
44
44
    cache_utf8,
45
45
    conflicts as _mod_conflicts,
 
46
    debug,
46
47
    delta,
47
48
    dirstate,
48
49
    errors,
55
56
    revision as _mod_revision,
56
57
    revisiontree,
57
58
    textui,
 
59
    trace,
58
60
    transform,
59
61
    urlutils,
60
62
    xml5,
431
433
 
432
434
    def _get_inventory(self):
433
435
        """Get the inventory for the tree. This is only valid within a lock."""
 
436
        if 'evil' in debug.debug_flags:
 
437
            trace.mutter_callsite(2,
 
438
                "accessing .inventory forces a size of tree translation.")
434
439
        if self._inventory is not None:
435
440
            return self._inventory
436
441
        self._must_be_locked()
568
573
        if parent_ids:
569
574
            return parent_ids[0]
570
575
        else:
571
 
            return None
 
576
            return _mod_revision.NULL_REVISION
572
577
 
573
578
    def lock_read(self):
574
579
        """See Branch.lock_read, and WorkingTree.unlock."""
1521
1526
    def get_reference_revision(self, file_id, path=None):
1522
1527
        return self.inventory[file_id].reference_revision
1523
1528
 
 
1529
    def iter_files_bytes(self, desired_files):
 
1530
        """See Tree.iter_files_bytes.
 
1531
 
 
1532
        This version is implemented on top of Repository.iter_files_bytes"""
 
1533
        parent_index = self._get_parent_index()
 
1534
        repo_desired_files = []
 
1535
        for file_id, identifier in desired_files:
 
1536
            entry = self._get_entry(file_id)
 
1537
            if entry == (None, None):
 
1538
                raise errors.NoSuchId(self, file_id)
 
1539
            repo_desired_files.append((file_id, entry[1][parent_index][4],
 
1540
                                       identifier))
 
1541
        return self._repository.iter_files_bytes(repo_desired_files)
 
1542
 
1524
1543
    def get_symlink_target(self, file_id):
1525
1544
        entry = self._get_entry(file_id=file_id)
1526
1545
        parent_index = self._get_parent_index()