]> arthur.barton.de Git - bup.git/commit - lib/bup/t/thelpers.py
Add a helpers.FSTime class to handle filesystem timestamps and use it.
authorRob Browning <rlb@defaultvalue.org>
Sun, 24 Oct 2010 20:30:46 +0000 (15:30 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 24 Oct 2010 20:30:46 +0000 (15:30 -0500)
commit15d2df2ac2395cba98ca4f4cc79a0d7bea516de0
treebbacbde890dfb38d31c106e000a1cc9bcb4caf0f
parente9d36e926d1fe6192535572fe529d3b1004e84ca
Add a helpers.FSTime class to handle filesystem timestamps and use it.

Add helpers.FSTime class to handle filesystem timestamps, and avoid
scattered conditionals.  At the moment, when _helpers.lstat is
available, FSTime stores timestamps as integer nanoseconds, otherwise
it uses the Python native stat representation (i.e. floating-point
seconds).  Operations like from_stat_time, from_timespec, to_timespec,
and approx_secs handle the appropriate conversions.

Add FSTime tests, and test both representations when the platform has
_helpers.lstat.
lib/bup/helpers.py
lib/bup/metadata.py
lib/bup/t/thelpers.py
lib/bup/t/tmetadata.py