rust/hg-core/src/dirstate/entry.rs
changeset 48447 af303ae33cd7
parent 48446 111098af6356
child 48448 0b3f3a3ca50a
equal deleted inserted replaced
48446:111098af6356 48447:af303ae33cd7
   128     /// Some APIs simply return zero when more precision is not available.
   128     /// Some APIs simply return zero when more precision is not available.
   129     /// When comparing values from different sources, if only one is truncated
   129     /// When comparing values from different sources, if only one is truncated
   130     /// in that way, doing a simple comparison would cause many false
   130     /// in that way, doing a simple comparison would cause many false
   131     /// negatives.
   131     /// negatives.
   132     pub fn likely_equal(self, other: Self) -> bool {
   132     pub fn likely_equal(self, other: Self) -> bool {
   133         self.truncated_seconds == other.truncated_seconds
   133         if self.truncated_seconds != other.truncated_seconds {
   134             && (self.nanoseconds == other.nanoseconds
   134             false
   135                 || self.nanoseconds == 0
   135         } else if self.nanoseconds == 0 || other.nanoseconds == 0 {
   136                 || other.nanoseconds == 0)
   136             if self.second_ambiguous {
       
   137                 false
       
   138             } else {
       
   139                 true
       
   140             }
       
   141         } else {
       
   142             self.nanoseconds == other.nanoseconds
       
   143         }
   137     }
   144     }
   138 
   145 
   139     pub fn likely_equal_to_mtime_of(
   146     pub fn likely_equal_to_mtime_of(
   140         self,
   147         self,
   141         metadata: &fs::Metadata,
   148         metadata: &fs::Metadata,