# HG changeset patch # User Adrian Buehlmann # Date 2012-07-03 23:31:37 # Node ID 2abe975ffb94ed77c32af766874fca6dabb3914e # Parent 48c232873a543111100776d1baa47c4bc1538060 dirstate: eliminate redundant check parameter on _addpath() state == 'a' implies check I fail to see what the point of this check parameter is. Near as I can see, the only _addpath call where it was set to True was in add(), but there, state is 'a'. This is a follow-up to c2016bae3b97. diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -312,10 +312,10 @@ class dirstate(object): if self[f] not in "?r" and "_dirs" in self.__dict__: _decdirs(self._dirs, f) - def _addpath(self, f, state, mode, size, mtime, check=False): + def _addpath(self, f, state, mode, size, mtime): assert state not in "?r" oldstate = self[f] - if check or oldstate == "r": + if state == 'a' or oldstate == 'r': scmutil.checkfilename(f) if f in self._dirs: raise util.Abort(_('directory %r already in dirstate') % f) @@ -377,7 +377,7 @@ class dirstate(object): def add(self, f): '''Mark a file added.''' - self._addpath(f, 'a', 0, -1, -1, True) + self._addpath(f, 'a', 0, -1, -1) if f in self._copymap: del self._copymap[f]