/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 repository.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:
151
151
    def lock_write(self):
152
152
        """See Branch.lock_write()."""
153
153
        if self._lock_mode:
154
 
            assert self._lock_mode == 'w'
 
154
            if self._lock_mode != 'w':
 
155
                raise errors.ReadOnlyError(self)
155
156
            self._lock_count += 1
156
157
        else:
157
158
            self._lock_mode = 'w'
170
171
 
171
172
    def lock_read(self):
172
173
        if self._lock_mode:
173
 
            assert self._lock_mode in ('r', 'w')
 
174
            if self._lock_mode not in ('r', 'w'):
 
175
                raise AssertionError
174
176
            self._lock_count += 1
175
177
        else:
176
178
            self._lock_mode = 'r'
431
433
        :raise KeyError: If foreign revision was not found
432
434
        :return: bzr revision id
433
435
        """
434
 
        assert type(foreign_revid) is str
 
436
        if type(foreign_revid) is not str:
 
437
            raise TypeError(foreign_revid)
435
438
        if mapping is None:
436
439
            mapping = self.get_mapping()
437
440
        if foreign_revid == ZERO_SHA:
529
532
            raise errors.NoSuchRevision(self, revision_id)
530
533
        revision, roundtrip_revid, verifiers = mapping.import_commit(
531
534
            commit, self.lookup_foreign_revision_id)
532
 
        assert revision is not None
 
535
        if revision is None:
 
536
            raise AssertionError
533
537
        # FIXME: check verifiers ?
534
538
        if roundtrip_revid:
535
539
            revision.revision_id = roundtrip_revid