mercurial/dirstate.py
changeset 47524 69a463a4f193
parent 47523 b76d54b90dc9
child 47525 fe4641cf9b72
equal deleted inserted replaced
47523:b76d54b90dc9 47524:69a463a4f193
   448         size=None,
   448         size=None,
   449         mtime=None,
   449         mtime=None,
   450         from_p2=False,
   450         from_p2=False,
   451         possibly_dirty=False,
   451         possibly_dirty=False,
   452     ):
   452     ):
   453         oldstate = self[f]
       
   454         entry = self._map.get(f)
   453         entry = self._map.get(f)
   455         if state == b'a' or entry is not None and entry.removed:
   454         if state == b'a' or entry is not None and entry.removed:
   456             scmutil.checkfilename(f)
   455             scmutil.checkfilename(f)
   457             if self._map.hastrackeddir(f):
   456             if self._map.hastrackeddir(f):
   458                 msg = _(b'directory %r already in dirstate')
   457                 msg = _(b'directory %r already in dirstate')
   469                     raise error.Abort(msg)
   468                     raise error.Abort(msg)
   470         self._dirty = True
   469         self._dirty = True
   471         self._updatedfiles.add(f)
   470         self._updatedfiles.add(f)
   472         self._map.addfile(
   471         self._map.addfile(
   473             f,
   472             f,
   474             oldstate,
       
   475             state=state,
   473             state=state,
   476             mode=mode,
   474             mode=mode,
   477             size=size,
   475             size=size,
   478             mtime=mtime,
   476             mtime=mtime,
   479             from_p2=from_p2,
   477             from_p2=from_p2,