/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-17 23:03:36 UTC
  • mfrom: (0.200.1860 work)
  • mto: (0.200.1889 work)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@jelmer.uk-20180317230336-zal9mv9o0vgli0s4
Merge lp:~jelmer/brz-git/gpg-signatures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
159
159
            basis_tree = self.repository.revision_tree(basis_revid)
160
160
        # Fill in entries that were not changed
161
161
        for path, entry in basis_tree.iter_entries_by_dir():
162
 
            assert isinstance(path, unicode)
 
162
            if type(path) is not unicode:
 
163
                raise TypeError(path)
163
164
            if entry.kind == 'directory':
164
165
                continue
165
166
            encoded_path = path.encode('utf-8')
180
181
            except AttributeError:
181
182
                fileid_map = {}
182
183
            for path, file_id in self._override_fileids.iteritems():
183
 
                assert type(path) == str
 
184
                if type(path) is not str:
 
185
                    raise TypeError(path)
184
186
                if file_id is None:
185
187
                    if path in fileid_map:
186
188
                        del fileid_map[path]
187
189
                else:
188
 
                    assert type(file_id) == str
 
190
                    if type(file_id) is not str:
 
191
                        raise TypeError(file_id)
189
192
                    fileid_map[path] = file_id
190
193
            if fileid_map:
191
194
                fileid_blob = self._mapping.export_fileid_map(fileid_map)
231
234
        if self._config_stack.get('create_signatures') == _mod_config.SIGN_ALWAYS:
232
235
            strategy = gpg.GPGStrategy(self._config_stack)
233
236
            c.gpgsig = strategy.sign(c.as_raw_string(), gpg.MODE_DETACH)
234
 
        assert len(c.id) == 40
235
237
        self.store.add_object(c)
236
238
        self.repository.commit_write_group()
237
239
        self._new_revision_id = self._mapping.revision_id_foreign_to_bzr(c.id)