mercurial/dirstate.py
changeset 47514 559aee84b889
parent 47513 10e740292dff
child 47515 c94d3ff46fd5
equal deleted inserted replaced
47513:10e740292dff 47514:559aee84b889
   391                     source = self._map.copymap.get(f)
   391                     source = self._map.copymap.get(f)
   392                     if source:
   392                     if source:
   393                         copies[f] = source
   393                         copies[f] = source
   394                     self.normallookup(f)
   394                     self.normallookup(f)
   395                 # Also fix up otherparent markers
   395                 # Also fix up otherparent markers
   396                 elif s.state == b'n' and s[2] == FROM_P2:
   396                 elif s.state == b'n' and s.from_p2:
   397                     source = self._map.copymap.get(f)
   397                     source = self._map.copymap.get(f)
   398                     if source:
   398                     if source:
   399                         copies[f] = source
   399                         copies[f] = source
   400                     self.add(f)
   400                     self.add(f)
   401         return copies
   401         return copies
   529             # if there is a merge going on and the file was either
   529             # if there is a merge going on and the file was either
   530             # "merged" or coming from other parent (-2) before
   530             # "merged" or coming from other parent (-2) before
   531             # being removed, restore that state.
   531             # being removed, restore that state.
   532             entry = self._map.get(f)
   532             entry = self._map.get(f)
   533             if entry is not None:
   533             if entry is not None:
   534                 if entry.state == b'r' and entry[2] in (NONNORMAL, FROM_P2):
   534                 if entry.state == b'r' and (
       
   535                     entry[2] == NONNORMAL or entry.from_p2
       
   536                 ):
   535                     source = self._map.copymap.get(f)
   537                     source = self._map.copymap.get(f)
   536                     if entry[2] == NONNORMAL:
   538                     if entry[2] == NONNORMAL:
   537                         self.merge(f)
   539                         self.merge(f)
   538                     elif entry[2] == FROM_P2:
   540                     elif entry.from_p2:
   539                         self.otherparent(f)
   541                         self.otherparent(f)
   540                     if source:
   542                     if source:
   541                         self.copy(source, f)
   543                         self.copy(source, f)
   542                     return
   544                     return
   543                 if entry.merged or entry.state == b'n' and entry[2] == FROM_P2:
   545                 if entry.merged or entry.state == b'n' and entry.from_p2:
   544                     return
   546                     return
   545         self._addpath(f, b'n', 0, possibly_dirty=True)
   547         self._addpath(f, b'n', 0, possibly_dirty=True)
   546         self._map.copymap.pop(f, None)
   548         self._map.copymap.pop(f, None)
   547 
   549 
   548     def otherparent(self, f):
   550     def otherparent(self, f):
  1334                     size >= 0
  1336                     size >= 0
  1335                     and (
  1337                     and (
  1336                         (size != st.st_size and size != st.st_size & _rangemask)
  1338                         (size != st.st_size and size != st.st_size & _rangemask)
  1337                         or ((mode ^ st.st_mode) & 0o100 and checkexec)
  1339                         or ((mode ^ st.st_mode) & 0o100 and checkexec)
  1338                     )
  1340                     )
  1339                     or size == FROM_P2  # other parent
  1341                     or t.from_p2
  1340                     or fn in copymap
  1342                     or fn in copymap
  1341                 ):
  1343                 ):
  1342                     if stat.S_ISLNK(st.st_mode) and size != st.st_size:
  1344                     if stat.S_ISLNK(st.st_mode) and size != st.st_size:
  1343                         # issue6456: Size returned may be longer due to
  1345                         # issue6456: Size returned may be longer due to
  1344                         # encryption on EXT-4 fscrypt, undecided.
  1346                         # encryption on EXT-4 fscrypt, undecided.