[Unison-hackers] Problem with fractional mtime? ("destination updated during synchronization")

Jerome Vouillon Jerome.Vouillon at pps.jussieu.fr
Fri Dec 5 11:50:15 EST 2008


On Sun, Nov 23, 2008 at 08:44:54AM -0500, Benjamin Pierce wrote:
> There is some rather tricky code in props.ml (in the sub-module Time)  
> that compares file modtimes while trying to take into account some  
> possible reasons why unchanged files may appear to have different  
> modtimes (e.g., daylight savings time, or one filesystem being FAT,  
> which can only store modtimes with a resolution of two seconds).  If  
> the problem you're seeing is really with fractional modtimes, it may  
> be possible to fix it by changing something here...

The fix should be the following:
- Use function similar_correct, which ignore one-second differences,
  instead of function similar in module Time in file props.ml
- Change the definition of function hash from
      let hash t h =
        Uutil.hash2
          (match t with
             Synced f    -> Hashtbl.hash (moduloOneHour (approximate f))
           | NotSynced _ -> 0)
          h
  to
      let hash t h = h
  (Two similar times should have the same hash; if we ignore
   one-second differences, this mean that all times should have the
   same hash.)
- Increment the variable archiveFormat in file update.ml
  (Indeed, the archive invariant is changed.)

This is a change that I have wanted to perform for some time, but
never did because of the archive format change.

-- Jerome


More information about the Unison-hackers mailing list