~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revisiontree.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        self._repository = branch
41
41
        self._weave_store = branch.weave_store
42
42
        self._inventory = inv
43
 
        assert inv.root is not None
44
43
        self._revision_id = revision_id
45
44
 
46
45
    def get_parent_ids(self):
48
47
 
49
48
        A RevisionTree's parents match the revision graph.
50
49
        """
51
 
        parent_ids = self._repository.get_revision(self._revision_id).parent_ids
 
50
        if self._revision_id not in (None, 'null:'):
 
51
            parent_ids = self._repository.get_revision(
 
52
                self._revision_id).parent_ids
 
53
        else:
 
54
            parent_ids = []
52
55
        return parent_ids
53
56
        
54
57
    def get_revision_id(self):
93
96
    def has_filename(self, filename):
94
97
        return bool(self.inventory.path2id(filename))
95
98
 
96
 
    def list_files(self):
 
99
    def list_files(self, include_root=False):
97
100
        # The only files returned by this are those from the version
98
101
        entries = self.inventory.iter_entries()
99
102
        # skip the root for compatability with the current apis.
100
 
        entries.next()
 
103
        if self.inventory.root is not None and not include_root:
 
104
            # skip the root for compatability with the current apis.
 
105
            entries.next()
101
106
        for path, entry in entries:
102
107
            yield path, 'V', entry.kind, entry.file_id, entry
103
108