mercurial/posix.py
changeset 51720 e618a1756b08
parent 51716 f3b34386d3e0
child 51799 1888846a1ee2
equal deleted inserted replaced
51719:7558cee89655 51720:e618a1756b08
   384     """Check that the base-relative path is a valid filename on this platform.
   384     """Check that the base-relative path is a valid filename on this platform.
   385     Returns None if the path is ok, or a UI string describing the problem."""
   385     Returns None if the path is ok, or a UI string describing the problem."""
   386     return None  # on posix platforms, every path is ok
   386     return None  # on posix platforms, every path is ok
   387 
   387 
   388 
   388 
   389 def getfsmountpoint(dirpath: bytes) -> Optional[bytes]:
   389 def getfsmountpoint(path: bytes) -> Optional[bytes]:
   390     """Get the filesystem mount point from a directory (best-effort)
   390     """Get the filesystem mount point from a directory (best-effort)
   391 
   391 
   392     Returns None if we are unsure. Raises OSError on ENOENT, EPERM, etc.
   392     Returns None if we are unsure. Raises OSError on ENOENT, EPERM, etc.
   393     """
   393     """
   394     return getattr(osutil, 'getfsmountpoint', lambda x: None)(dirpath)
   394     return getattr(osutil, 'getfsmountpoint', lambda x: None)(path)
   395 
   395 
   396 
   396 
   397 def getfstype(dirpath: bytes) -> Optional[bytes]:
   397 def getfstype(path: bytes) -> Optional[bytes]:
   398     """Get the filesystem type name from a directory (best-effort)
   398     """Get the filesystem type name from a directory (best-effort)
   399 
   399 
   400     Returns None if we are unsure. Raises OSError on ENOENT, EPERM, etc.
   400     Returns None if we are unsure. Raises OSError on ENOENT, EPERM, etc.
   401     """
   401     """
   402     return getattr(osutil, 'getfstype', lambda x: None)(dirpath)
   402     return getattr(osutil, 'getfstype', lambda x: None)(path)
   403 
   403 
   404 
   404 
   405 def get_password() -> bytes:
   405 def get_password() -> bytes:
   406     return encoding.strtolocal(getpass.getpass(''))
   406     return encoding.strtolocal(getpass.getpass(''))
   407 
   407 
   689     os.mkdir(path)
   689     os.mkdir(path)
   690 
   690 
   691 
   691 
   692 def lookupreg(
   692 def lookupreg(
   693     key: bytes,
   693     key: bytes,
   694     name: Optional[bytes] = None,
   694     valname: Optional[bytes] = None,
   695     scope: Optional[Union[int, Iterable[int]]] = None,
   695     scope: Optional[Union[int, Iterable[int]]] = None,
   696 ) -> Optional[bytes]:
   696 ) -> Optional[bytes]:
   697     return None
   697     return None
   698 
   698 
   699 
   699