mercurial/dirstate.py
changeset 6298 53cbb33e1269
parent 6297 fed1a9c22076
child 6326 af3f26b6bba4
equal deleted inserted replaced
6297:fed1a9c22076 6298:53cbb33e1269
   242         if f in self._copymap:
   242         if f in self._copymap:
   243             del self._copymap[f]
   243             del self._copymap[f]
   244 
   244 
   245     def normallookup(self, f):
   245     def normallookup(self, f):
   246         'mark a file normal, but possibly dirty'
   246         'mark a file normal, but possibly dirty'
       
   247         if self._pl[1] != nullid and f in self._map:
       
   248             # if there is a merge going on and the file was either
       
   249             # in state 'm' or dirty before being removed, restore that state.
       
   250             entry = self._map[f]
       
   251             if entry[0] == 'r' and entry[2] in (-1, -2):
       
   252                 source = self._copymap.get(f)
       
   253                 if entry[2] == -1:
       
   254                     self.merge(f)
       
   255                 elif entry[2] == -2:
       
   256                     self.normaldirty(f)
       
   257                 if source:
       
   258                     self.copy(source, f)
       
   259                 return
       
   260             if entry[0] == 'm' or entry[0] == 'n' and entry[2] == -2:
       
   261                 return
   247         self._dirty = True
   262         self._dirty = True
   248         self._changepath(f, 'n', True)
   263         self._changepath(f, 'n', True)
   249         self._map[f] = ('n', 0, -1, -1, 0)
   264         self._map[f] = ('n', 0, -1, -1, 0)
   250         if f in self._copymap:
   265         if f in self._copymap:
   251             del self._copymap[f]
   266             del self._copymap[f]