Mercurial > hg
diff mercurial/dirstate.py @ 47525:fe4641cf9b72
dirstate: use a `added` parameter to _addpath
My next target are the explicit `state` byte, so let start with abstracting
their initial storage.
Differential Revision: https://phab.mercurial-scm.org/D10967
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 04 Jul 2021 01:42:10 +0200 |
parents | 69a463a4f193 |
children | 8bcae9bf9e8d |
line wrap: on
line diff
--- a/mercurial/dirstate.py Sat Jul 03 20:59:26 2021 +0200 +++ b/mercurial/dirstate.py Sun Jul 04 01:42:10 2021 +0200 @@ -443,15 +443,16 @@ def _addpath( self, f, - state, - mode, + state=None, + mode=0, size=None, mtime=None, + added=False, from_p2=False, possibly_dirty=False, ): entry = self._map.get(f) - if state == b'a' or entry is not None and entry.removed: + if added or entry is not None and entry.removed: scmutil.checkfilename(f) if self._map.hastrackeddir(f): msg = _(b'directory %r already in dirstate') @@ -474,6 +475,7 @@ mode=mode, size=size, mtime=mtime, + added=added, from_p2=from_p2, possibly_dirty=possibly_dirty, ) @@ -544,7 +546,7 @@ def add(self, f): '''Mark a file added.''' - self._addpath(f, b'a', 0) + self._addpath(f, added=True) self._map.copymap.pop(f, None) def remove(self, f):