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

  • Committer: Jelmer Vernooij
  • Date: 2018-03-27 01:46:08 UTC
  • mto: (0.200.1897 work)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@jelmer.uk-20180327014608-ohpu76jyoe3lsso3
Avoid expensive bzr APIs in commit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
156
156
                basis_revid = self.parents[0]
157
157
            basis_tree = self.repository.revision_tree(basis_revid)
158
158
        # Fill in entries that were not changed
159
 
        for path, entry in basis_tree.iter_entries_by_dir():
160
 
            if type(path) is not unicode:
161
 
                raise TypeError(path)
162
 
            if entry.kind == 'directory':
 
159
        for entry in basis_tree._iter_tree_contents(include_trees=False):
 
160
            if entry.path in self._blobs:
163
161
                continue
164
 
            encoded_path = path.encode('utf-8')
165
 
            if encoded_path not in self._blobs:
166
 
                if entry.kind == "symlink":
167
 
                    blob = Blob()
168
 
                    blob.data = basis_tree.get_symlink_target(path, entry.file_id).encode('utf-8')
169
 
                    self._blobs[encoded_path] = (entry_mode(entry), blob.id)
170
 
                elif entry.kind == "file":
171
 
                    blob = Blob()
172
 
                    blob.data = basis_tree.get_file_text(path, entry.file_id)
173
 
                    self._blobs[encoded_path] = (entry_mode(entry), blob.id)
174
 
                else:
175
 
                    raise NotImplementedError
 
162
            self._blobs[entry.path] = (entry.mode, entry.sha)
176
163
        if not self._lossy:
177
164
            try:
178
165
                fileid_map = dict(basis_tree._fileid_map.file_ids)