mercurial/localrepo.py
branchstable
changeset 50324 e6532a7336d0
parent 50323 6901916458bd
child 50437 3a2df812e1c7
equal deleted inserted replaced
50323:6901916458bd 50324:e6532a7336d0
  1803             use_dirstate_v2,
  1803             use_dirstate_v2,
  1804             use_tracked_hint=use_tracked_hint,
  1804             use_tracked_hint=use_tracked_hint,
  1805         )
  1805         )
  1806 
  1806 
  1807     def _dirstatevalidate(self, node):
  1807     def _dirstatevalidate(self, node):
       
  1808         okay = True
  1808         try:
  1809         try:
  1809             self.changelog.rev(node)
  1810             self.changelog.rev(node)
       
  1811         except error.LookupError:
       
  1812             # If the parent are unknown it might just be because the changelog
       
  1813             # in memory is lagging behind the dirstate in memory. So try to
       
  1814             # refresh the changelog first.
       
  1815             #
       
  1816             # We only do so if we don't hold the lock, if we do hold the lock
       
  1817             # the invalidation at that time should have taken care of this and
       
  1818             # something is very fishy.
       
  1819             if self.currentlock() is None:
       
  1820                 self.invalidate()
       
  1821                 try:
       
  1822                     self.changelog.rev(node)
       
  1823                 except error.LookupError:
       
  1824                     okay = False
       
  1825             else:
       
  1826                 # XXX we should consider raising an error here.
       
  1827                 okay = False
       
  1828         if okay:
  1810             return node
  1829             return node
  1811         except error.LookupError:
  1830         else:
  1812             if not self._dirstatevalidatewarned:
  1831             if not self._dirstatevalidatewarned:
  1813                 self._dirstatevalidatewarned = True
  1832                 self._dirstatevalidatewarned = True
  1814                 self.ui.warn(
  1833                 self.ui.warn(
  1815                     _(b"warning: ignoring unknown working parent %s!\n")
  1834                     _(b"warning: ignoring unknown working parent %s!\n")
  1816                     % short(node)
  1835                     % short(node)