Robert Collins has proposed merging lp:~lifeless/python-oops-datedir-repo/0.0.8 
into lp:python-oops-datedir-repo.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~lifeless/python-oops-datedir-repo/0.0.8/+merge/78543

I made a booboo in 0.0.7 which ec2 found for me in LP. This fixes it an obvious 
way (isdir is easier than catching an OSError exception and checking its the 
exact error that might happen).
-- 
https://code.launchpad.net/~lifeless/python-oops-datedir-repo/0.0.8/+merge/78543
Your team Launchpad code reviewers is requested to review the proposed merge of 
lp:~lifeless/python-oops-datedir-repo/0.0.8 into lp:python-oops-datedir-repo.
=== modified file 'NEWS'
--- NEWS	2011-10-04 05:09:28 +0000
+++ NEWS	2011-10-07 06:07:26 +0000
@@ -6,6 +6,15 @@
 NEXT
 ----
 
+0.0.8
+-----
+
+* Set a specific version for the oops dependency - fixes bootstrapping.
+  (Robert Collins)
+
+* Fix broken code in 0.0.7's hash naming support - only create the target date
+  directory once. (Robert Collins)
+
 0.0.7
 -----
 

=== modified file 'oops_datedir_repo/__init__.py'
--- oops_datedir_repo/__init__.py	2011-10-04 04:13:53 +0000
+++ oops_datedir_repo/__init__.py	2011-10-07 06:07:26 +0000
@@ -25,7 +25,7 @@
 # established at this point, and setup.py will use a version of next-$(revno).
 # If the releaselevel is 'final', then the tarball will be major.minor.micro.
 # Otherwise it is major.minor.micro~$(revno).
-__version__ = (0, 0, 7, 'beta', 0)
+__version__ = (0, 0, 8, 'beta', 0)
 
 __all__ = [
     'DateDirRepo',

=== modified file 'oops_datedir_repo/repository.py'
--- oops_datedir_repo/repository.py	2011-10-04 05:08:20 +0000
+++ oops_datedir_repo/repository.py	2011-10-07 06:07:26 +0000
@@ -85,7 +85,8 @@
             md5hash = md5(serializer_bson.dumps(report)).hexdigest()
             oopsid = 'OOPS-%s' % md5hash
             prefix = os.path.join(self.root, now.strftime('%Y-%m-%d'))
-            os.makedirs(prefix)
+            if not os.path.isdir(prefix):
+                os.makedirs(prefix)
             filename = os.path.join(prefix, oopsid)
         report['id'] = oopsid
         self.serializer.write(report, open(filename, 'wb'))

=== modified file 'oops_datedir_repo/tests/test_repository.py'
--- oops_datedir_repo/tests/test_repository.py	2011-10-04 05:08:20 +0000
+++ oops_datedir_repo/tests/test_repository.py	2011-10-07 06:07:26 +0000
@@ -96,3 +96,12 @@
             self.assertEqual(
                 {'id': expected_id, 'time': now},
                 bson.loads(fp.read()))
+
+    def test_multiple_hash_publications(self):
+        # The initial datedir hash code could only publish one oops a day.
+        repo = DateDirRepo(self.useFixture(TempDir()).path)
+        now = datetime.datetime(2006, 04, 01, 00, 30, 00, tzinfo=utc)
+        report = {'time': now}
+        repo.publish(report, now)
+        report2 = {'time': now, 'foo': 'bar'}
+        repo.publish(report2, now)

=== modified file 'setup.py'
--- setup.py	2011-10-04 04:13:53 +0000
+++ setup.py	2011-10-07 06:07:26 +0000
@@ -22,7 +22,7 @@
 description = file(os.path.join(os.path.dirname(__file__), 'README'), 'rb').read()
 
 setup(name="oops_datedir_repo",
-      version="0.0.7",
+      version="0.0.8",
       description="OOPS disk serialisation and repository management.",
       long_description=description,
       maintainer="Launchpad Developers",

=== modified file 'versions.cfg'
--- versions.cfg	2011-10-04 04:13:53 +0000
+++ versions.cfg	2011-10-07 06:07:26 +0000
@@ -5,6 +5,7 @@
 bson = 0.3.2
 fixtures = 0.3.6
 iso8601 = 0.1.4
+oops = 0.0.8
 pytz = 2010o
 setuptools = 0.6c11
 testtools = 0.9.11

_______________________________________________
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp

Reply via email to