comparison mercurial/dirstate.py @ 47909:f89ac1ed2bc6

dirstate: drop the deprecated `normal` method The method was deprecated in 5.9. Differential Revision: https://phab.mercurial-scm.org/D11344
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 24 Aug 2021 21:08:09 +0200
parents 3853e6ee160d
children 50bed873a765
comparison
equal deleted inserted replaced
47908:74a8d5c6fdc6 47909: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: