Mercurial > hg
changeset 17196:2abe975ffb94
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.
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Wed, 04 Jul 2012 01:31:37 +0200 |
parents | 48c232873a54 |
children | 67b8cca2f12b |
files | mercurial/dirstate.py |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/dirstate.py Mon Jul 16 22:37:44 2012 +0200 +++ b/mercurial/dirstate.py Wed Jul 04 01:31:37 2012 +0200 @@ -312,10 +312,10 @@ 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 @@ 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]