rust/hg-core/src/dirstate_tree/dispatch.rs
changeset 48056 cd13d3c2ad2e
parent 48051 98c0408324e6
child 48061 060cd909439f
equal deleted inserted replaced
48055:84e7a86e3a63 48056:cd13d3c2ad2e
    65     fn drop_entry_and_copy_source(
    65     fn drop_entry_and_copy_source(
    66         &mut self,
    66         &mut self,
    67         filename: &HgPath,
    67         filename: &HgPath,
    68     ) -> Result<(), DirstateError>;
    68     ) -> Result<(), DirstateError>;
    69 
    69 
    70     /// Among given files, mark the stored `mtime` as ambiguous if there is one
       
    71     /// (if `state == EntryState::Normal`) equal to the given current Unix
       
    72     /// timestamp.
       
    73     fn clear_ambiguous_times(
       
    74         &mut self,
       
    75         filenames: Vec<HgPathBuf>,
       
    76         now: i32,
       
    77     ) -> Result<(), DirstateV2ParseError>;
       
    78 
       
    79     /// Return whether the map has an "non-normal" entry for the given
    70     /// Return whether the map has an "non-normal" entry for the given
    80     /// filename. That is, any entry with a `state` other than
    71     /// filename. That is, any entry with a `state` other than
    81     /// `EntryState::Normal` or with an ambiguous `mtime`.
    72     /// `EntryState::Normal` or with an ambiguous `mtime`.
    82     fn non_normal_entries_contains(
    73     fn non_normal_entries_contains(
    83         &mut self,
    74         &mut self,
   163 
   154 
   164     /// Returns whether the sub-tree rooted at the given directory contains any
   155     /// Returns whether the sub-tree rooted at the given directory contains any
   165     /// file with a dirstate entry.
   156     /// file with a dirstate entry.
   166     fn has_dir(&mut self, directory: &HgPath) -> Result<bool, DirstateError>;
   157     fn has_dir(&mut self, directory: &HgPath) -> Result<bool, DirstateError>;
   167 
   158 
   168     /// Clear mtimes that are ambigous with `now` (similar to
   159     /// Clear mtimes equal to `now` in entries with `state ==
   169     /// `clear_ambiguous_times` but for all files in the dirstate map), and
   160     /// EntryState::Normal`, and serialize bytes to write the `.hg/dirstate`
   170     /// serialize bytes to write the `.hg/dirstate` file to disk in dirstate-v1
   161     /// file to disk in dirstate-v1 format.
   171     /// format.
       
   172     fn pack_v1(
   162     fn pack_v1(
   173         &mut self,
   163         &mut self,
   174         parents: DirstateParents,
   164         parents: DirstateParents,
   175         now: Timestamp,
   165         now: Timestamp,
   176     ) -> Result<Vec<u8>, DirstateError>;
   166     ) -> Result<Vec<u8>, DirstateError>;
   177 
   167 
   178     /// Clear mtimes that are ambigous with `now` (similar to
   168     /// Clear mtimes equal to `now` in entries with `state ==
   179     /// `clear_ambiguous_times` but for all files in the dirstate map), and
   169     /// EntryState::Normal`, and serialize  bytes to write a dirstate data file
   180     /// serialize bytes to write a dirstate data file to disk in dirstate-v2
   170     /// to disk in dirstate-v2 format.
   181     /// format.
       
   182     ///
   171     ///
   183     /// Returns new data and metadata together with whether that data should be
   172     /// Returns new data and metadata together with whether that data should be
   184     /// appended to the existing data file whose content is at
   173     /// appended to the existing data file whose content is at
   185     /// `self.on_disk` (true), instead of written to a new data file
   174     /// `self.on_disk` (true), instead of written to a new data file
   186     /// (false).
   175     /// (false).
   337     fn drop_entry_and_copy_source(
   326     fn drop_entry_and_copy_source(
   338         &mut self,
   327         &mut self,
   339         filename: &HgPath,
   328         filename: &HgPath,
   340     ) -> Result<(), DirstateError> {
   329     ) -> Result<(), DirstateError> {
   341         self.drop_entry_and_copy_source(filename)
   330         self.drop_entry_and_copy_source(filename)
   342     }
       
   343 
       
   344     fn clear_ambiguous_times(
       
   345         &mut self,
       
   346         filenames: Vec<HgPathBuf>,
       
   347         now: i32,
       
   348     ) -> Result<(), DirstateV2ParseError> {
       
   349         Ok(self.clear_ambiguous_times(filenames, now))
       
   350     }
   331     }
   351 
   332 
   352     fn non_normal_entries_contains(
   333     fn non_normal_entries_contains(
   353         &mut self,
   334         &mut self,
   354         key: &HgPath,
   335         key: &HgPath,