~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/pack_repo.py

Raise an error on duplicate pack name allocation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1095
1095
        """
1096
1096
        self.ensure_loaded()
1097
1097
        if a_new_pack.name in self._names:
1098
 
            # a collision with the packs we know about (not the only possible
1099
 
            # collision, see NewPack.finish() for some discussion). Remove our
1100
 
            # prior reference to it.
1101
 
            self._remove_pack_from_memory(a_new_pack)
 
1098
            raise errors.BzrError(
 
1099
                'Pack %r already exists in %s' % (a_new_pack.name, self))
1102
1100
        self._names[a_new_pack.name] = tuple(a_new_pack.index_sizes)
1103
1101
        self.add_pack_to_memory(a_new_pack)
1104
1102