474 entry = self._map.get(filename) |
474 entry = self._map.get(filename) |
475 if entry is None: |
475 if entry is None: |
476 self._add(filename) |
476 self._add(filename) |
477 return True |
477 return True |
478 elif not entry.tracked: |
478 elif not entry.tracked: |
479 self.normallookup(filename) |
479 self._normallookup(filename) |
480 return True |
480 return True |
481 # XXX This is probably overkill for more case, but we need this to |
481 # XXX This is probably overkill for more case, but we need this to |
482 # fully replace the `normallookup` call with `set_tracked` one. |
482 # fully replace the `normallookup` call with `set_tracked` one. |
483 # Consider smoothing this in the future. |
483 # Consider smoothing this in the future. |
484 self.set_possibly_dirty(filename) |
484 self.set_possibly_dirty(filename) |
744 # modifications that happen within the same timeslot. |
744 # modifications that happen within the same timeslot. |
745 self._lastnormaltime = mtime |
745 self._lastnormaltime = mtime |
746 |
746 |
747 def normallookup(self, f): |
747 def normallookup(self, f): |
748 '''Mark a file normal, but possibly dirty.''' |
748 '''Mark a file normal, but possibly dirty.''' |
|
749 if self.pendingparentchange(): |
|
750 util.nouideprecwarn( |
|
751 b"do not use `normallookup` inside of update/merge context." |
|
752 b" Use `update_file` or `update_file_p1`", |
|
753 b'6.0', |
|
754 stacklevel=2, |
|
755 ) |
|
756 else: |
|
757 util.nouideprecwarn( |
|
758 b"do not use `normallookup` outside of update/merge context." |
|
759 b" Use `set_possibly_dirty` or `set_tracked`", |
|
760 b'6.0', |
|
761 stacklevel=2, |
|
762 ) |
|
763 self._normallookup(f) |
|
764 |
|
765 def _normallookup(self, f): |
|
766 '''Mark a file normal, but possibly dirty.''' |
749 if self.in_merge: |
767 if self.in_merge: |
750 # if there is a merge going on and the file was either |
768 # if there is a merge going on and the file was either |
751 # "merged" or coming from other parent (-2) before |
769 # "merged" or coming from other parent (-2) before |
752 # being removed, restore that state. |
770 # being removed, restore that state. |
753 entry = self._map.get(f) |
771 entry = self._map.get(f) |
823 self._map.removefile(filename, in_merge=self.in_merge) |
841 self._map.removefile(filename, in_merge=self.in_merge) |
824 |
842 |
825 def merge(self, f): |
843 def merge(self, f): |
826 '''Mark a file merged.''' |
844 '''Mark a file merged.''' |
827 if not self.in_merge: |
845 if not self.in_merge: |
828 return self.normallookup(f) |
846 return self._normallookup(f) |
829 return self.otherparent(f) |
847 return self.otherparent(f) |
830 |
848 |
831 def drop(self, f): |
849 def drop(self, f): |
832 '''Drop a file from the dirstate''' |
850 '''Drop a file from the dirstate''' |
833 if not self.pendingparentchange(): |
851 if not self.pendingparentchange(): |