mercurial/dirstate.py
changeset 35082 e6c64744781f
parent 35081 a947cf872799
child 35083 e8ae0b2d88a8
equal deleted inserted replaced
35081:a947cf872799 35082:e6c64744781f
   385 
   385 
   386     def copies(self):
   386     def copies(self):
   387         return self._map.copymap
   387         return self._map.copymap
   388 
   388 
   389     def _droppath(self, f):
   389     def _droppath(self, f):
   390         if "filefoldmap" in self._map.__dict__:
       
   391             normed = util.normcase(f)
       
   392             if normed in self._map.filefoldmap:
       
   393                 del self._map.filefoldmap[normed]
       
   394 
       
   395         self._updatedfiles.add(f)
   390         self._updatedfiles.add(f)
   396 
   391 
   397     def _addpath(self, f, state, mode, size, mtime):
   392     def _addpath(self, f, state, mode, size, mtime):
   398         oldstate = self[f]
   393         oldstate = self[f]
   399         if state == 'a' or oldstate == 'r':
   394         if state == 'a' or oldstate == 'r':
  1211     - `filefoldmap` is a dict mapping normalized filenames to the denormalized
  1206     - `filefoldmap` is a dict mapping normalized filenames to the denormalized
  1212       form that they appear as in the dirstate.
  1207       form that they appear as in the dirstate.
  1213 
  1208 
  1214     - `dirfoldmap` is a dict mapping normalized directory names to the
  1209     - `dirfoldmap` is a dict mapping normalized directory names to the
  1215       denormalized form that they appear as in the dirstate.
  1210       denormalized form that they appear as in the dirstate.
  1216 
       
  1217     Once instantiated, the filefoldmap and dirfoldmap views must be maintained
       
  1218     by the caller.
       
  1219     """
  1211     """
  1220 
  1212 
  1221     def __init__(self, ui, opener, root):
  1213     def __init__(self, ui, opener, root):
  1222         self._ui = ui
  1214         self._ui = ui
  1223         self._opener = opener
  1215         self._opener = opener
  1295         the file's previous state.  In the future, we should refactor this
  1287         the file's previous state.  In the future, we should refactor this
  1296         to be more explicit about what that state is.
  1288         to be more explicit about what that state is.
  1297         """
  1289         """
  1298         if oldstate not in "?r" and "dirs" in self.__dict__:
  1290         if oldstate not in "?r" and "dirs" in self.__dict__:
  1299             self.dirs.delpath(f)
  1291             self.dirs.delpath(f)
       
  1292         if "filefoldmap" in self.__dict__:
       
  1293             normed = util.normcase(f)
       
  1294             self.filefoldmap.pop(normed, None)
  1300         self._map[f] = dirstatetuple('r', 0, size, 0)
  1295         self._map[f] = dirstatetuple('r', 0, size, 0)
  1301         self.nonnormalset.add(f)
  1296         self.nonnormalset.add(f)
  1302 
  1297 
  1303     def dropfile(self, f, oldstate):
  1298     def dropfile(self, f, oldstate):
  1304         """
  1299         """
  1307         """
  1302         """
  1308         exists = self._map.pop(f, None) is not None
  1303         exists = self._map.pop(f, None) is not None
  1309         if exists:
  1304         if exists:
  1310             if oldstate != "r" and "dirs" in self.__dict__:
  1305             if oldstate != "r" and "dirs" in self.__dict__:
  1311                 self.dirs.delpath(f)
  1306                 self.dirs.delpath(f)
       
  1307         if "filefoldmap" in self.__dict__:
       
  1308             normed = util.normcase(f)
       
  1309             self.filefoldmap.pop(normed, None)
  1312         self.nonnormalset.discard(f)
  1310         self.nonnormalset.discard(f)
  1313         return exists
  1311         return exists
  1314 
  1312 
  1315     def clearambiguoustimes(self, files, now):
  1313     def clearambiguoustimes(self, files, now):
  1316         for f in files:
  1314         for f in files: