comparison mercurial/dirstate.py @ 47972:5a6c1ef4bcac

dirstate: make dirstatemap.set_untracked deal with added file This merge dropfile in set_untracked. Differential Revision: https://phab.mercurial-scm.org/D11419
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 02 Sep 2021 02:53:47 +0200
parents c0157aca5bf5
children 2e0ff3947b05
comparison
equal deleted inserted replaced
47971:c0157aca5bf5 47972:5a6c1ef4bcac
491 This function is to be called outside of "update/merge" case. For 491 This function is to be called outside of "update/merge" case. For
492 example by a command like `hg remove X`. 492 example by a command like `hg remove X`.
493 493
494 return True the file was previously tracked, False otherwise. 494 return True the file was previously tracked, False otherwise.
495 """ 495 """
496 entry = self._map.get(filename) 496 ret = self._map.set_untracked(filename)
497 if entry is None: 497 if ret:
498 return False
499 else:
500 self._dirty = True 498 self._dirty = True
501 self._updatedfiles.add(filename) 499 self._updatedfiles.add(filename)
502 if entry.added: 500 return ret
503 self._map.dropfile(filename)
504 else:
505 self._map.set_untracked(filename)
506 return True
507 501
508 @requires_no_parents_change 502 @requires_no_parents_change
509 def set_clean(self, filename, parentfiledata=None): 503 def set_clean(self, filename, parentfiledata=None):
510 """record that the current state of the file on disk is known to be clean""" 504 """record that the current state of the file on disk is known to be clean"""
511 self._dirty = True 505 self._dirty = True