~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revisiontree.py

  • Committer: wang
  • Date: 2006-10-29 13:41:32 UTC
  • mto: (2104.4.1 wang_65714)
  • mto: This revision was merged to the branch mainline in revision 2109.
  • Revision ID: wang@ubuntu-20061029134132-3d7f4216f20c4aef
Replace python's difflib by patiencediff because the worst case 
performance is cubic for difflib and people commiting large data 
files are often hurt by this. The worst case performance of patience is 
quadratic. Fix bug 65714.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
 
48
48
        A RevisionTree's parents match the revision graph.
49
49
        """
50
 
        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 = []
51
55
        return parent_ids
52
56
        
53
57
    def get_revision_id(self):
92
96
    def has_filename(self, filename):
93
97
        return bool(self.inventory.path2id(filename))
94
98
 
95
 
    def list_files(self):
 
99
    def list_files(self, include_root=False):
96
100
        # The only files returned by this are those from the version
97
101
        entries = self.inventory.iter_entries()
98
102
        # skip the root for compatability with the current apis.
99
 
        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()
100
106
        for path, entry in entries:
101
107
            yield path, 'V', entry.kind, entry.file_id, entry
102
108