From 243481f6da90d8c3b4c7f54abf54481f9e058c28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Borgstr=C3=B6m?= Date: Tue, 3 Jun 2014 22:00:34 +0200 Subject: [PATCH] Fix test suite breakage --- attic/cache.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/attic/cache.py b/attic/cache.py index 7146c4f3c..af2f9ee79 100644 --- a/attic/cache.py +++ b/attic/cache.py @@ -5,7 +5,8 @@ import os from binascii import hexlify import shutil -from .helpers import Error, get_cache_dir, decode_dict, st_mtime_ns, unhexlify, UpgradableLock +from .helpers import Error, get_cache_dir, decode_dict, st_mtime_ns, unhexlify, UpgradableLock, int_to_bigint, \ + bigint_to_int from .hashindex import ChunkIndex @@ -210,7 +211,7 @@ class Cache(object): if not entry: return None entry = msgpack.unpackb(entry) - if entry[1] == st.st_ino and entry[2] == st.st_size and entry[3] == st_mtime_ns(st): + if entry[2] == st.st_size and bigint_to_int(entry[3]) == st_mtime_ns(st) and entry[1] == st.st_ino: # reset entry age entry[0] = 0 self.files[path_hash] = msgpack.packb(entry) @@ -221,5 +222,5 @@ class Cache(object): def memorize_file(self, path_hash, st, ids): # Entry: Age, inode, size, mtime, chunk ids mtime_ns = st_mtime_ns(st) - self.files[path_hash] = msgpack.packb((0, st.st_ino, st.st_size, mtime_ns, ids)) + self.files[path_hash] = msgpack.packb((0, st.st_ino, st.st_size, int_to_bigint(mtime_ns), ids)) self._newest_mtime = max(self._newest_mtime, mtime_ns)