]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Compare size and ctime as well as mtime.
authorDaira Hopwood <daira@jacaranda.org>
Mon, 14 Sep 2015 17:21:09 +0000 (18:21 +0100)
committerDaira Hopwood <daira@jacaranda.org>
Tue, 15 Sep 2015 17:43:01 +0000 (18:43 +0100)
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
src/allmydata/backupdb.py

index 9e8b52739aa1cc990c55389cabcf853cd53aa563..e6f723ae3b992c5946c930e81f46630569abbf9e 100644 (file)
@@ -418,7 +418,8 @@ class MagicFolderDB(BackupDB):
 
     def is_new_file_time(self, path, relpath_u):
         """recent_file_time returns true if the file is recent...
-        meaning it's current mtime matched the mtime that was previously stored in the db.
+        meaning its current statinfo (i.e. size, ctime, and mtime) matched the statinfo
+        that was previously stored in the db.
         """
         print "check_file_time %s %s" % (path, relpath_u)
         path = abspath_expanduser_unicode(path)
@@ -426,7 +427,6 @@ class MagicFolderDB(BackupDB):
         size = s[stat.ST_SIZE]
         ctime = s[stat.ST_CTIME]
         mtime = s[stat.ST_MTIME]
-        now = time.time()
         c = self.cursor
         c.execute("SELECT size,mtime,ctime,fileid"
                   " FROM local_files"
@@ -436,7 +436,7 @@ class MagicFolderDB(BackupDB):
         if not row:
             return True
         (last_size,last_mtime,last_ctime,last_fileid) = row
-        if int(mtime) == int(last_mtime):
+        if (size, ctime, mtime) == (last_size, last_ctime, last_mtime):
             return False
         else:
             return True