mercurial/dirstatemap.py
changeset 52102 82e2c99c84f3
parent 52054 ea0467ed76aa
equal deleted inserted replaced
52101:720d9849dcf9 52102:82e2c99c84f3
   111 
   111 
   112     def _set_identity(self) -> None:
   112     def _set_identity(self) -> None:
   113         self.identity = self._get_current_identity()
   113         self.identity = self._get_current_identity()
   114 
   114 
   115     def _get_current_identity(self) -> Optional[typelib.CacheStat]:
   115     def _get_current_identity(self) -> Optional[typelib.CacheStat]:
       
   116         # TODO have a cleaner approach on httpstaticrepo side
       
   117         path = self._opener.join(self._filename)
       
   118         if path.startswith(b'https://') or path.startswith(b'http://'):
       
   119             return util.uncacheable_cachestat()
   116         try:
   120         try:
   117             return util.cachestat(self._opener.join(self._filename))
   121             return util.cachestat(path)
   118         except FileNotFoundError:
   122         except FileNotFoundError:
   119             return None
   123             return None
   120 
   124 
   121     def may_need_refresh(self) -> bool:
   125     def may_need_refresh(self) -> bool:
   122         if 'identity' not in vars(self):
   126         if 'identity' not in vars(self):