r73435 - in /trunk/libcache-historical-perl/debian: changelog patches/0001-Make-values-really-sort-as-documented.patch patches/series

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Sun Apr 24 18:04:33 UTC 2011


Author: gregoa
Date: Sun Apr 24 18:03:05 2011
New Revision: 73435

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=73435
Log:
Add patch by Niko Tyni to make values() really sort as documented
(closes: #615882).

Added:
    trunk/libcache-historical-perl/debian/patches/0001-Make-values-really-sort-as-documented.patch
Modified:
    trunk/libcache-historical-perl/debian/changelog
    trunk/libcache-historical-perl/debian/patches/series

Modified: trunk/libcache-historical-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcache-historical-perl/debian/changelog?rev=73435&op=diff
==============================================================================
--- trunk/libcache-historical-perl/debian/changelog (original)
+++ trunk/libcache-historical-perl/debian/changelog Sun Apr 24 18:03:05 2011
@@ -1,3 +1,10 @@
+libcache-historical-perl (0.03-2) UNRELEASED; urgency=low
+
+  * Add patch by Niko Tyni to make values() really sort as documented
+    (closes: #615882).
+
+ -- gregor herrmann <gregoa at debian.org>  Sun, 24 Apr 2011 20:00:21 +0200
+
 libcache-historical-perl (0.03-1) unstable; urgency=low
 
   * Initial release. (Closes: #566280)

Added: trunk/libcache-historical-perl/debian/patches/0001-Make-values-really-sort-as-documented.patch
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcache-historical-perl/debian/patches/0001-Make-values-really-sort-as-documented.patch?rev=73435&op=file
==============================================================================
--- trunk/libcache-historical-perl/debian/patches/0001-Make-values-really-sort-as-documented.patch (added)
+++ trunk/libcache-historical-perl/debian/patches/0001-Make-values-really-sort-as-documented.patch Sun Apr 24 18:03:05 2011
@@ -1,0 +1,57 @@
+Origin: vendor
+Bug-Debian: http://bugs.debian.org/615882
+Forwarded: no
+Reviewed-by: gregor herrmann <gregoa at debian.org>
+Last-Update: 2011-04-24
+
+From 0db8d46e47239773409760d65c53d55434df1aad Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni at debian.org>
+Date: Mon, 18 Apr 2011 21:06:04 +0300
+Subject: [PATCH] Make values() really sort as documented
+
+The values() method used to sort the returned list by the update time
+(newest first), contrary to the documentation.
+
+This was mostly missed by the test suite, except on rare occasions,
+because the time stamps don't use sub-second precision. Only when the
+threshold between full seconds happened in the middle of the data
+insertion statements, the values() test in t/001Basic.t failed.
+
+Fix the method, change the data insertion statement order, and add a
+sleep statement in the middle to make sure the bug stays fixed.
+---
+ Historical.pm |    2 +-
+ t/001Basic.t  |    3 ++-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/Historical.pm b/Historical.pm
+index e080642..b88b06a 100644
+--- a/Historical.pm
++++ b/Historical.pm
+@@ -178,7 +178,7 @@ sub values {
+ 
+     my $values = Cache::Historical::Val::Manager->get_vals(
+         query => [ @key ],
+-        sort_by => ['upd_time DESC'],
++        sort_by => ['date'],
+     );
+ 
+     for(@$values) {
+diff --git a/t/001Basic.t b/t/001Basic.t
+index 67fac46..fee8145 100755
+--- a/t/001Basic.t
++++ b/t/001Basic.t
+@@ -17,8 +17,9 @@ my $c = Cache::Historical->new(
+ my $fmt = DateTime::Format::Strptime->new(
+               pattern => "%Y-%m-%d");
+ 
+-$c->set( $fmt->parse_datetime("2008-01-02"), "msft", 35.22 );
+ $c->set( $fmt->parse_datetime("2008-01-03"), "msft", 35.37 );
++$c->set( $fmt->parse_datetime("2008-01-02"), "msft", 35.22 );
++sleep 1; # so the update time is never the same for all the rows
+ $c->set( $fmt->parse_datetime("2008-01-04"), "msft", 34.38 );
+ $c->set( $fmt->parse_datetime("2008-01-07"), "msft", 34.61 );
+ 
+-- 
+1.7.4.1
+

Modified: trunk/libcache-historical-perl/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcache-historical-perl/debian/patches/series?rev=73435&op=diff
==============================================================================
--- trunk/libcache-historical-perl/debian/patches/series (original)
+++ trunk/libcache-historical-perl/debian/patches/series Sun Apr 24 18:03:05 2011
@@ -1,1 +1,2 @@
 10_pod_error.diff
+0001-Make-values-really-sort-as-documented.patch -p1




More information about the Pkg-perl-cvs-commits mailing list