allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject allura git commit: Include microseconds in posts' full_slug
Date Mon, 11 Jan 2016 15:46:17 GMT
Repository: allura
Updated Branches:
  refs/heads/master fc1ca949c -> 57480b6c7


Include microseconds in posts' full_slug

Now comments posted in the same second will still be ordered properly.
Fixes intermittently failing test_delete_attachment


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/57480b6c
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/57480b6c
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/57480b6c

Branch: refs/heads/master
Commit: 57480b6c798729ce3a99e450c6cd7135ac90435a
Parents: fc1ca94
Author: Dave Brondsema <dave@brondsema.net>
Authored: Fri Jan 8 17:02:01 2016 -0500
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Mon Jan 11 17:45:44 2016 +0200

----------------------------------------------------------------------
 Allura/allura/model/artifact.py            | 2 +-
 Allura/allura/tests/model/test_artifact.py | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/57480b6c/Allura/allura/model/artifact.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/artifact.py b/Allura/allura/model/artifact.py
index 09a3a38..3d798fd 100644
--- a/Allura/allura/model/artifact.py
+++ b/Allura/allura/model/artifact.py
@@ -631,7 +631,7 @@ class Message(Artifact):
         part = h.nonce()
         if timestamp is None:
             timestamp = datetime.utcnow()
-        dt = timestamp.strftime('%Y%m%d%H%M%S')
+        dt = timestamp.strftime('%Y%m%d%H%M%S%f')
         slug = part
         full_slug = dt + ':' + part
         if parent:

http://git-wip-us.apache.org/repos/asf/allura/blob/57480b6c/Allura/allura/tests/model/test_artifact.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_artifact.py b/Allura/allura/tests/model/test_artifact.py
index b7e9dc0..bac284e 100644
--- a/Allura/allura/tests/model/test_artifact.py
+++ b/Allura/allura/tests/model/test_artifact.py
@@ -53,8 +53,7 @@ class Checkmessage(M.Message):
     def __init__(self, **kw):
         super(Checkmessage, self).__init__(**kw)
         if self.slug is not None and self.full_slug is None:
-            self.full_slug = datetime.utcnow().strftime(
-                '%Y%m%d%H%M%S') + ':' + self.slug
+            self.full_slug = datetime.utcnow().strftime('%Y%m%d%H%M%S%f') + ':' + self.slug
 Mapper.compile_all()
 
 


Mime
View raw message