@@ -45,11 +45,13 @@ def _raise_if_ssh_host_key_error(url: str, exc: SubprocessCommandError) -> None:
4545 """Raise a helpful RuntimeError if *exc* looks like an SSH host-key failure."""
4646 stderr_lower = exc .stderr .lower ()
4747 if any (msg in stderr_lower for msg in _SSH_HOST_KEY_MSGS ):
48+ parsed = urlparse (url )
49+ host_only = parsed .hostname or url
4850 target = _ssh_target_from_url (url )
4951 raise RuntimeError (
5052 f"SSH host key verification failed while connecting to '{ url } '.\n "
5153 "Add the host to your known hosts file, for example by running:\n "
52- f" ssh-keyscan { target } >> ~/.ssh/known_hosts\n "
54+ f" ssh-keyscan { host_only } >> ~/.ssh/known_hosts\n "
5355 "Or test the SSH connection manually:\n "
5456 f" ssh -T { target } "
5557 ) from exc
@@ -134,7 +136,7 @@ def list_of_tags(self) -> list[str]:
134136 )
135137 except SubprocessCommandError as exc :
136138 _raise_if_ssh_host_key_error (self ._remote , exc )
137- raise
139+ return []
138140 return [
139141 str (tag ).strip ("/\r " ) for tag in result .stdout .decode ().split ("\n " ) if tag
140142 ]
@@ -205,7 +207,11 @@ def is_svn(self) -> bool:
205207 """Check if is SVN."""
206208 try :
207209 with in_directory (self ._path ):
208- run_on_cmdline (logger , ["svn" , "info" , "--non-interactive" ])
210+ run_on_cmdline (
211+ logger ,
212+ ["svn" , "info" , "--non-interactive" ],
213+ env = _extend_env_for_non_interactive_mode (),
214+ )
209215 return True
210216 except (SubprocessCommandError , RuntimeError ):
211217 return False
@@ -222,6 +228,7 @@ def externals(self) -> list[External]:
222228 "svn:externals" ,
223229 "-R" ,
224230 ],
231+ env = _extend_env_for_non_interactive_mode (),
225232 )
226233 repo_root = SvnRepo .get_info_from_target ()["Repository Root" ]
227234 return SvnRepo ._parse_externals (
@@ -518,7 +525,9 @@ def create_diff(
518525 )
519526
520527 with in_directory (self ._path ):
521- patch_text = run_on_cmdline (logger , cmd ).stdout
528+ patch_text = run_on_cmdline (
529+ logger , cmd , env = _extend_env_for_non_interactive_mode ()
530+ ).stdout
522531
523532 if not patch_text .strip ():
524533 return Patch .empty ().convert_type (PatchType .SVN )
@@ -537,6 +546,7 @@ def get_username(self) -> str:
537546 "author" ,
538547 self ._path ,
539548 ],
549+ env = _extend_env_for_non_interactive_mode (),
540550 )
541551 return str (result .stdout .decode ().strip ())
542552 except SubprocessCommandError :
0 commit comments