mercurial/dirstatemap.py
changeset 47542 b8013cb71ef3
parent 47539 84391ddf4c78
child 47668 724a77979b47
equal deleted inserted replaced
47541:a9f38b144096 47542:b8013cb71ef3
   217             # would be nice.
   217             # would be nice.
   218             if entry is not None:
   218             if entry is not None:
   219                 # backup the previous state
   219                 # backup the previous state
   220                 if entry.merged:  # merge
   220                 if entry.merged:  # merge
   221                     size = NONNORMAL
   221                     size = NONNORMAL
   222                 elif entry[0] == b'n' and entry.from_p2:
   222                 elif entry.from_p2:
   223                     size = FROM_P2
   223                     size = FROM_P2
   224                     self.otherparentset.add(f)
   224                     self.otherparentset.add(f)
   225         if size == 0:
   225         if size == 0:
   226             self.copymap.pop(f, None)
   226             self.copymap.pop(f, None)
   227 
   227 
   228         if entry is not None and entry[0] != b'r' and "_dirs" in self.__dict__:
   228         if entry is not None and not entry.removed and "_dirs" in self.__dict__:
   229             self._dirs.delpath(f)
   229             self._dirs.delpath(f)
   230         if entry is None and "_alldirs" in self.__dict__:
   230         if entry is None and "_alldirs" in self.__dict__:
   231             self._alldirs.addpath(f)
   231             self._alldirs.addpath(f)
   232         if "filefoldmap" in self.__dict__:
   232         if "filefoldmap" in self.__dict__:
   233             normed = util.normcase(f)
   233             normed = util.normcase(f)
   258         return exists
   258         return exists
   259 
   259 
   260     def clearambiguoustimes(self, files, now):
   260     def clearambiguoustimes(self, files, now):
   261         for f in files:
   261         for f in files:
   262             e = self.get(f)
   262             e = self.get(f)
   263             if e is not None and e[0] == b'n' and e[3] == now:
   263             if e is not None and e.need_delay(now):
   264                 self._map[f] = DirstateItem(e[0], e[1], e[2], AMBIGUOUS_TIME)
   264                 self._map[f] = DirstateItem(
       
   265                     e.state, e.mode, e.size, AMBIGUOUS_TIME
       
   266                 )
   265                 self.nonnormalset.add(f)
   267                 self.nonnormalset.add(f)
   266 
   268 
   267     def nonnormalentries(self):
   269     def nonnormalentries(self):
   268         '''Compute the nonnormal dirstate entries from the dmap'''
   270         '''Compute the nonnormal dirstate entries from the dmap'''
   269         try:
   271         try:
   270             return parsers.nonnormalotherparententries(self._map)
   272             return parsers.nonnormalotherparententries(self._map)
   271         except AttributeError:
   273         except AttributeError:
   272             nonnorm = set()
   274             nonnorm = set()
   273             otherparent = set()
   275             otherparent = set()
   274             for fname, e in pycompat.iteritems(self._map):
   276             for fname, e in pycompat.iteritems(self._map):
   275                 if e[0] != b'n' or e[3] == AMBIGUOUS_TIME:
   277                 if e.state != b'n' or e.mtime == AMBIGUOUS_TIME:
   276                     nonnorm.add(fname)
   278                     nonnorm.add(fname)
   277                 if e[0] == b'n' and e[2] == FROM_P2:
   279                 if e.from_p2:
   278                     otherparent.add(fname)
   280                     otherparent.add(fname)
   279             return nonnorm, otherparent
   281             return nonnorm, otherparent
   280 
   282 
   281     @propertycache
   283     @propertycache
   282     def filefoldmap(self):
   284     def filefoldmap(self):
   293             )
   295             )
   294 
   296 
   295         f = {}
   297         f = {}
   296         normcase = util.normcase
   298         normcase = util.normcase
   297         for name, s in pycompat.iteritems(self._map):
   299         for name, s in pycompat.iteritems(self._map):
   298             if s[0] != b'r':
   300             if not s.removed:
   299                 f[normcase(name)] = name
   301                 f[normcase(name)] = name
   300         f[b'.'] = b'.'  # prevents useless util.fspath() invocation
   302         f[b'.'] = b'.'  # prevents useless util.fspath() invocation
   301         return f
   303         return f
   302 
   304 
   303     def hastrackeddir(self, d):
   305     def hastrackeddir(self, d):