Rev 4938: We need to define atime, and on some systems futimes() only has 1s resolution. in http://bazaar.launchpad.net/~jameinel/bzr/2.1.0rc1-set-mtime

John Arbash Meinel john at arbash-meinel.com
Tue Jan 5 21:38:50 GMT 2010


At http://bazaar.launchpad.net/~jameinel/bzr/2.1.0rc1-set-mtime

------------------------------------------------------------
revno: 4938
revision-id: john at arbash-meinel.com-20100105213830-g3lquxafftzzqlmm
parent: john at arbash-meinel.com-20100105212855-xgsy8aziw1ag9377
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1.0rc1-set-mtime
timestamp: Tue 2010-01-05 15:38:30 -0600
message:
  We need to define atime, and on some systems futimes() only has 1s resolution.
-------------- next part --------------
=== modified file 'bzrlib/_readdir_pyx.pyx'
--- a/bzrlib/_readdir_pyx.pyx	2010-01-05 21:28:55 +0000
+++ b/bzrlib/_readdir_pyx.pyx	2010-01-05 21:38:30 +0000
@@ -60,6 +60,7 @@
         off_t st_size
         int st_dev
         ino_t st_ino
+        time_t st_atime
         int st_mtime
         int st_ctime
     int fstat(int fd, stat *buf)

=== modified file 'bzrlib/tests/test_osutils.py'
--- a/bzrlib/tests/test_osutils.py	2010-01-05 21:15:22 +0000
+++ b/bzrlib/tests/test_osutils.py	2010-01-05 21:38:30 +0000
@@ -2034,4 +2034,7 @@
         finally:
             f.close()
         self.assertNotEqual(mtime, new_mtime)
-        self.assertEqual(new_mtime, os.lstat('test').st_mtime)
+        # We don't guarantee any better than 1s resolution, though we try to
+        # use functions that have at least microsecond resolution (1us on
+        # POSIX, 100ns on Windows)
+        self.assertEqual(int(new_mtime), int(os.lstat('test').st_mtime))



More information about the bazaar-commits mailing list