/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 breezy/plugins/fastimport/bzr_commit_handler.py

  • Committer: Jelmer Vernooij
  • Date: 2018-07-03 23:54:50 UTC
  • mto: (7027.4.10 python3-blackbox)
  • mto: This revision was merged to the branch mainline in revision 7029.
  • Revision ID: jelmer@jelmer.uk-20180703235450-p10v67yhkzsebucd
Port fastimport to python3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
363
363
            self.directory_entries[path] = ie
364
364
            # There are no lines stored for a directory so
365
365
            # make sure the cache used by get_lines knows that
366
 
            self.data_for_commit[file_id] = ''
 
366
            self.data_for_commit[file_id] = b''
367
367
        elif kind == 'symlink':
368
368
            ie.symlink_target = self._decode_path(data)
369
369
            # There are no lines stored for a symlink so
370
370
            # make sure the cache used by get_lines knows that
371
 
            self.data_for_commit[file_id] = ''
 
371
            self.data_for_commit[file_id] = b''
372
372
        else:
373
373
            self.warning("Cannot import items of kind '%s' yet - ignoring '%s'"
374
374
                % (kind, path))
413
413
        self.directory_entries[dirname] = ie
414
414
        # There are no lines stored for a directory so
415
415
        # make sure the cache used by get_lines knows that
416
 
        self.data_for_commit[dir_file_id] = ''
 
416
        self.data_for_commit[dir_file_id] = b''
417
417
 
418
418
        # It's possible that a file or symlink with that file-id
419
419
        # already exists. If it does, we need to delete it.
520
520
        # that means the loader then needs to know what the "new" text is.
521
521
        # We therefore must go back to the revision store to get it.
522
522
        lines = self.rev_store.get_file_lines(rev_id, file_id)
523
 
        self.data_for_commit[file_id] = ''.join(lines)
 
523
        self.data_for_commit[file_id] = b''.join(lines)
524
524
 
525
525
    def _delete_all_items(self, inv):
526
526
        if len(inv) == 0:
730
730
            # used. However, it is cheaper than having to create a full copy of
731
731
            # the inventory for every commit.
732
732
            new_inv = self.basis_inventory.create_by_apply_delta(delta,
733
 
                'not-a-valid-revision-id:')
 
733
                b'not-a-valid-revision-id:')
734
734
        else:
735
735
            new_inv = inventory.Inventory(revision_id=self.revision_id)
736
736
            # This is set in the delta so remove it to prevent a duplicate