# HG changeset patch # User Pierre-Yves David # Date 1625184347 -7200 # Node ID 523c00383e79050ba05311c5929a8db49dbc1eb8 # Parent 5eb65ec12465bb0019344c7c6d984db3b41a7018 dirstate: add default value to _addpath We want to remove the magic value usage from the higher level, so lets stop passing them explicitely when possible. Differential Revision: https://phab.mercurial-scm.org/D10930 diff -r 5eb65ec12465 -r 523c00383e79 mercurial/dirstate.py --- a/mercurial/dirstate.py Fri Jul 02 01:02:46 2021 +0200 +++ b/mercurial/dirstate.py Fri Jul 02 02:05:47 2021 +0200 @@ -438,7 +438,7 @@ def copies(self): return self._map.copymap - def _addpath(self, f, state, mode, size, mtime): + def _addpath(self, f, state, mode, size=NONNORMAL, mtime=AMBIGUOUS_TIME): oldstate = self[f] if state == b'a' or oldstate == b'r': scmutil.checkfilename(f) @@ -509,7 +509,7 @@ return if entry[0] == b'm' or entry[0] == b'n' and entry[2] == FROM_P2: return - self._addpath(f, b'n', 0, NONNORMAL, AMBIGUOUS_TIME) + self._addpath(f, b'n', 0) self._map.copymap.pop(f, None) def otherparent(self, f): @@ -519,15 +519,15 @@ raise error.Abort(msg) if f in self and self[f] == b'n': # merge-like - self._addpath(f, b'm', 0, FROM_P2, AMBIGUOUS_TIME) + self._addpath(f, b'm', 0, FROM_P2) else: # add-like - self._addpath(f, b'n', 0, FROM_P2, AMBIGUOUS_TIME) + self._addpath(f, b'n', 0, FROM_P2) self._map.copymap.pop(f, None) def add(self, f): '''Mark a file added.''' - self._addpath(f, b'a', 0, NONNORMAL, AMBIGUOUS_TIME) + self._addpath(f, b'a', 0) self._map.copymap.pop(f, None) def remove(self, f):