mercurial/dirstate.py
changeset 47589 f5c24c124e07
parent 47558 811a79bfb8bb
child 47590 c5190adc17d5
equal deleted inserted replaced
47588:eb611ecb435c 47589:f5c24c124e07
   385                 # Also fix up otherparent markers
   385                 # Also fix up otherparent markers
   386                 elif s.from_p2:
   386                 elif s.from_p2:
   387                     source = self._map.copymap.get(f)
   387                     source = self._map.copymap.get(f)
   388                     if source:
   388                     if source:
   389                         copies[f] = source
   389                         copies[f] = source
   390                     self.add(f)
   390                     self._add(f)
   391         return copies
   391         return copies
   392 
   392 
   393     def setbranch(self, branch):
   393     def setbranch(self, branch):
   394         self.__class__._branch.set(self, encoding.fromlocal(branch))
   394         self.__class__._branch.set(self, encoding.fromlocal(branch))
   395         f = self._opener(b'branch', b'w', atomictemp=True, checkambig=True)
   395         f = self._opener(b'branch', b'w', atomictemp=True, checkambig=True)
   545             self._addpath(f, from_p2=True)
   545             self._addpath(f, from_p2=True)
   546         self._map.copymap.pop(f, None)
   546         self._map.copymap.pop(f, None)
   547 
   547 
   548     def add(self, f):
   548     def add(self, f):
   549         '''Mark a file added.'''
   549         '''Mark a file added.'''
   550         self._addpath(f, added=True)
   550         self._add(f)
   551         self._map.copymap.pop(f, None)
   551 
       
   552     def _add(self, filename):
       
   553         """internal function to mark a file as added"""
       
   554         self._addpath(filename, added=True)
       
   555         self._map.copymap.pop(filename, None)
   552 
   556 
   553     def remove(self, f):
   557     def remove(self, f):
   554         '''Mark a file removed.'''
   558         '''Mark a file removed.'''
   555         self._dirty = True
   559         self._dirty = True
   556         self._updatedfiles.add(f)
   560         self._updatedfiles.add(f)