Mercurial > hg
comparison mercurial/dirstate.py @ 49963:23b70ce09e55
dirstate: rename `@requires_parents_change` to `@requires_changing_parents`
This match the rename of the context manager.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 26 Jan 2023 15:17:29 +0100 |
parents | 5b0beaf45491 |
children | f979d8af8648 |
comparison
equal
deleted
inserted
replaced
49962:5b0beaf45491 | 49963:23b70ce09e55 |
---|---|
64 | 64 |
65 def join(self, obj, fname): | 65 def join(self, obj, fname): |
66 return obj._join(fname) | 66 return obj._join(fname) |
67 | 67 |
68 | 68 |
69 def requires_parents_change(func): | 69 def requires_changing_parents(func): |
70 def wrap(self, *args, **kwargs): | 70 def wrap(self, *args, **kwargs): |
71 if not self.pendingparentchange(): | 71 if not self.pendingparentchange(): |
72 msg = 'calling `%s` outside of a changing_parents context' | 72 msg = 'calling `%s` outside of a changing_parents context' |
73 msg %= func.__name__ | 73 msg %= func.__name__ |
74 raise error.ProgrammingError(msg) | 74 raise error.ProgrammingError(msg) |
528 def set_possibly_dirty(self, filename): | 528 def set_possibly_dirty(self, filename): |
529 """record that the current state of the file on disk is unknown""" | 529 """record that the current state of the file on disk is unknown""" |
530 self._dirty = True | 530 self._dirty = True |
531 self._map.set_possibly_dirty(filename) | 531 self._map.set_possibly_dirty(filename) |
532 | 532 |
533 @requires_parents_change | 533 @requires_changing_parents |
534 def update_file_p1( | 534 def update_file_p1( |
535 self, | 535 self, |
536 filename, | 536 filename, |
537 p1_tracked, | 537 p1_tracked, |
538 ): | 538 ): |
568 # the underlying reference might have changed, we will have to | 568 # the underlying reference might have changed, we will have to |
569 # check it. | 569 # check it. |
570 has_meaningful_mtime=False, | 570 has_meaningful_mtime=False, |
571 ) | 571 ) |
572 | 572 |
573 @requires_parents_change | 573 @requires_changing_parents |
574 def update_file( | 574 def update_file( |
575 self, | 575 self, |
576 filename, | 576 filename, |
577 wc_tracked, | 577 wc_tracked, |
578 p1_tracked, | 578 p1_tracked, |