From: David Stainton Date: Sat, 12 Sep 2015 18:09:55 +0000 (+0200) Subject: Fix version incrementation bug X-Git-Url: https://git.rkrishnan.org/simplejson/components/%22file:/something?a=commitdiff_plain;h=a53361da4b8ea2cea89e9a7d48b091f6abb2c2c2;p=tahoe-lafs%2Ftahoe-lafs.git Fix version incrementation bug only increment if mtimes are differing... --- diff --git a/src/allmydata/frontends/magic_folder.py b/src/allmydata/frontends/magic_folder.py index c7e58978..88f507db 100644 --- a/src/allmydata/frontends/magic_folder.py +++ b/src/allmydata/frontends/magic_folder.py @@ -346,7 +346,11 @@ class Uploader(QueueMixin): if version is None: version = 0 else: - version += 1 + if self._db.is_new_file_time(os.path.join(self._local_path_u, relpath_u), relpath_u): + version += 1 + print "version incremented to %s" % (version,) + else: + print "version not incremented" uploadable = FileName(path_u, self._client.convergence) d2 = self._upload_dirnode.add_file(encoded_name_u, uploadable, metadata={"version":version}, overwrite=True)