Mercurial > hg
comparison mercurial/dirstatemap.py @ 47998:938a7769050c
dirstate: support file tracked nowhere in `reset_state`
This let the dirstatemap decide when to drop files.
Differential Revision: https://phab.mercurial-scm.org/D11438
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 15 Sep 2021 18:36:59 +0200 |
parents | 70547a7d5930 |
children | 5e7eea915019 |
comparison
equal
deleted
inserted
replaced
47997:70547a7d5930 | 47998:938a7769050c |
---|---|
178 self.nonnormalset.discard(filename) | 178 self.nonnormalset.discard(filename) |
179 | 179 |
180 def reset_state( | 180 def reset_state( |
181 self, | 181 self, |
182 filename, | 182 filename, |
183 wc_tracked, | 183 wc_tracked=False, |
184 p1_tracked, | 184 p1_tracked=False, |
185 p2_tracked=False, | 185 p2_tracked=False, |
186 merged=False, | 186 merged=False, |
187 clean_p1=False, | 187 clean_p1=False, |
188 clean_p2=False, | 188 clean_p2=False, |
189 possibly_dirty=False, | 189 possibly_dirty=False, |
204 # copy information are now outdated | 204 # copy information are now outdated |
205 # (maybe new information should be in directly passed to this function) | 205 # (maybe new information should be in directly passed to this function) |
206 self.copymap.pop(filename, None) | 206 self.copymap.pop(filename, None) |
207 | 207 |
208 if not (p1_tracked or p2_tracked or wc_tracked): | 208 if not (p1_tracked or p2_tracked or wc_tracked): |
209 self.dropfile(filename) | 209 old_entry = self._map.pop(filename, None) |
210 self._dirs_decr(filename, old_entry=old_entry) | |
211 self.nonnormalset.discard(filename) | |
212 self.copymap.pop(filename, None) | |
210 return | 213 return |
211 elif merged: | 214 elif merged: |
212 # XXX might be merged and removed ? | 215 # XXX might be merged and removed ? |
213 entry = self.get(filename) | 216 entry = self.get(filename) |
214 if entry is None or not entry.tracked: | 217 if entry is None or not entry.tracked: |
574 return ret | 577 return ret |
575 | 578 |
576 def reset_state( | 579 def reset_state( |
577 self, | 580 self, |
578 filename, | 581 filename, |
579 wc_tracked, | 582 wc_tracked=False, |
580 p1_tracked, | 583 p1_tracked=False, |
581 p2_tracked=False, | 584 p2_tracked=False, |
582 merged=False, | 585 merged=False, |
583 clean_p1=False, | 586 clean_p1=False, |
584 clean_p2=False, | 587 clean_p2=False, |
585 possibly_dirty=False, | 588 possibly_dirty=False, |