Rev 2968: Raise an error on duplicate pack name allocation. in http://people.ubuntu.com/~robertc/baz2.0/reconcile

Robert Collins robertc at robertcollins.net
Wed Nov 28 23:36:36 GMT 2007


At http://people.ubuntu.com/~robertc/baz2.0/reconcile

------------------------------------------------------------
revno: 2968
revision-id:robertc at robertcollins.net-20071128233626-7prd9kkgj1l0kmk1
parent: robertc at robertcollins.net-20071128233229-n0blldup87wo4vhq
committer: Robert Collins <robertc at robertcollins.net>
branch nick: reconcile.packs
timestamp: Thu 2007-11-29 10:36:26 +1100
message:
  Raise an error on duplicate pack name allocation.
modified:
  bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py	2007-11-28 23:32:29 +0000
+++ b/bzrlib/repofmt/pack_repo.py	2007-11-28 23:36:26 +0000
@@ -1095,10 +1095,8 @@
         """
         self.ensure_loaded()
         if a_new_pack.name in self._names:
-            # a collision with the packs we know about (not the only possible
-            # collision, see NewPack.finish() for some discussion). Remove our
-            # prior reference to it.
-            self._remove_pack_from_memory(a_new_pack)
+            raise errors.BzrError(
+                'Pack %r already exists in %s' % (a_new_pack.name, self))
         self._names[a_new_pack.name] = tuple(a_new_pack.index_sizes)
         self.add_pack_to_memory(a_new_pack)
 



More information about the bazaar-commits mailing list