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

Handle unicode decoding of commit messages in bzr-fastimport, python-fastimport no longer takes care of this.

Show diffs side-by-side

added added

removed removed

Lines of Context:
261
261
        self._save_author_info(rev_props)
262
262
        committer = self.command.committer
263
263
        who = self._format_name_email(committer[0], committer[1])
264
 
        message = self.command.message
 
264
        try:
 
265
            message = self.command.message.decode("utf-8")
 
266
        except UnicodeDecodeError:
 
267
            self.warning(
 
268
                "commit message not in utf8 - replacing unknown characters")
 
269
            message = message.decode('utf-8', 'replace')
265
270
        if not _serializer_handles_escaping:
266
271
            # We need to assume the bad ol' days
267
272
            message = helpers.escape_commit_message(message)