mercurial/dirstate.py
changeset 47940 f89ac1ed2bc6
parent 47921 3853e6ee160d
child 47941 50bed873a765
equal deleted inserted replaced
47939:74a8d5c6fdc6 47940:f89ac1ed2bc6
   702         s = os.lstat(self._join(filename))
   702         s = os.lstat(self._join(filename))
   703         mode = s.st_mode
   703         mode = s.st_mode
   704         size = s.st_size
   704         size = s.st_size
   705         mtime = s[stat.ST_MTIME]
   705         mtime = s[stat.ST_MTIME]
   706         return (mode, size, mtime)
   706         return (mode, size, mtime)
   707 
       
   708     def normal(self, f, parentfiledata=None):
       
   709         """Mark a file normal and clean.
       
   710 
       
   711         parentfiledata: (mode, size, mtime) of the clean file
       
   712 
       
   713         parentfiledata should be computed from memory (for mode,
       
   714         size), as or close as possible from the point where we
       
   715         determined the file was clean, to limit the risk of the
       
   716         file having been changed by an external process between the
       
   717         moment where the file was determined to be clean and now."""
       
   718         if self.pendingparentchange():
       
   719             util.nouideprecwarn(
       
   720                 b"do not use `normal` inside of update/merge context."
       
   721                 b" Use `update_file` or `update_file_p1`",
       
   722                 b'6.0',
       
   723                 stacklevel=2,
       
   724             )
       
   725         else:
       
   726             util.nouideprecwarn(
       
   727                 b"do not use `normal` outside of update/merge context."
       
   728                 b" Use `set_tracked`",
       
   729                 b'6.0',
       
   730                 stacklevel=2,
       
   731             )
       
   732         self._normal(f, parentfiledata=parentfiledata)
       
   733 
   707 
   734     def _normal(self, f, parentfiledata=None):
   708     def _normal(self, f, parentfiledata=None):
   735         if parentfiledata:
   709         if parentfiledata:
   736             (mode, size, mtime) = parentfiledata
   710             (mode, size, mtime) = parentfiledata
   737         else:
   711         else: