[PATCH] Bug fix in store.py (with test update)

Magnus Therning magnus at therning.org
Tue Aug 23 23:59:18 BST 2005


A test was missing for ImmutableStore, and adding it resulted in a bug.

*** modified file 'bzrlib/store.py'
--- bzrlib/store.py 
+++ bzrlib/store.py 
@@ -49,6 +49,10 @@
     False
 
     You are not allowed to add an id that is already present.
+    >>> st.add(StringIO('good bye'), 'aa') #doctest: +IGNORE_EXCEPTION_DETAIL
+    Traceback (most recent call last):
+        ...
+    BzrError: store 'X' already contains id 'aa'
 
     Entries can be retrieved as files, which may then be read.
 
@@ -90,7 +94,7 @@
             
         p = self._path(fileid)
         if os.access(p, os.F_OK) or os.access(p + '.gz', os.F_OK):
-            from bzrlib.errors import bailout
+            from bzrlib.errors import BzrError
             raise BzrError("store %r already contains id %r" % (self._basedir, fileid))
 
         fn = p


-- 
Magnus Therning                    (OpenPGP: 0xAB4DFBA4)
magnus at therning.org
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

Only the insane take themselves quite seriously.
     -- Sir Max Beerbohm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050823/329de679/attachment.pgp 


More information about the bazaar mailing list