Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Dec 11, 2024
1 parent 3e7db71 commit 77b3778
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ tee = "0.1"
tempfile = "3"
typenum = "1"
url = "2"
which = "7"

[dependencies.bstr]
version = "1"
Expand Down
11 changes: 11 additions & 0 deletions src/hg_connect_stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,17 @@ pub fn get_stdio_connection(url: &Url, flags: c_int) -> Option<Box<dyn HgRepo>>
path.as_os_str().as_bytes().to_owned()
};
let path = CString::new(path).unwrap();
warn!(target: "root", "{:?}", which::which("hg"));
if let Ok(hg) = which::which("hg") {
use bstr::ByteSlice;
let output = std::process::Command::new(hg).arg("--version").output().unwrap();
warn!(target: "root", "{}", output.stdout.as_bstr());
warn!(target: "root", "{}", output.stderr.as_bstr());

let output = std::process::Command::new("/bin/sh").args(["-x", "-c", "hg --version"]).output().unwrap();
warn!(target: "root", "{}", output.stdout.as_bstr());
warn!(target: "root", "{}", output.stderr.as_bstr());
}
let proc = unsafe {
hg_connect_stdio(
userhost.as_ref().map_or(ptr::null(), |s| s.as_ptr()),
Expand Down

0 comments on commit 77b3778

Please sign in to comment.