mercurial/dirstate.py
changeset 17196 2abe975ffb94
parent 17094 c2016bae3b97
child 17197 67b8cca2f12b
equal deleted inserted replaced
17195:48c232873a54 17196:2abe975ffb94
   310 
   310 
   311     def _droppath(self, f):
   311     def _droppath(self, f):
   312         if self[f] not in "?r" and "_dirs" in self.__dict__:
   312         if self[f] not in "?r" and "_dirs" in self.__dict__:
   313             _decdirs(self._dirs, f)
   313             _decdirs(self._dirs, f)
   314 
   314 
   315     def _addpath(self, f, state, mode, size, mtime, check=False):
   315     def _addpath(self, f, state, mode, size, mtime):
   316         assert state not in "?r"
   316         assert state not in "?r"
   317         oldstate = self[f]
   317         oldstate = self[f]
   318         if check or oldstate == "r":
   318         if state == 'a' or oldstate == 'r':
   319             scmutil.checkfilename(f)
   319             scmutil.checkfilename(f)
   320             if f in self._dirs:
   320             if f in self._dirs:
   321                 raise util.Abort(_('directory %r already in dirstate') % f)
   321                 raise util.Abort(_('directory %r already in dirstate') % f)
   322             # shadows
   322             # shadows
   323             for d in _finddirs(f):
   323             for d in _finddirs(f):
   375         if f in self._copymap:
   375         if f in self._copymap:
   376             del self._copymap[f]
   376             del self._copymap[f]
   377 
   377 
   378     def add(self, f):
   378     def add(self, f):
   379         '''Mark a file added.'''
   379         '''Mark a file added.'''
   380         self._addpath(f, 'a', 0, -1, -1, True)
   380         self._addpath(f, 'a', 0, -1, -1)
   381         if f in self._copymap:
   381         if f in self._copymap:
   382             del self._copymap[f]
   382             del self._copymap[f]
   383 
   383 
   384     def remove(self, f):
   384     def remove(self, f):
   385         '''Mark a file removed.'''
   385         '''Mark a file removed.'''