diff rust/chg/src/main.rs @ 44673:0a2516efc463

rust-chg: move set_current_dir() to Locator This is necessary to run config validation in proper environment. Differential Revision: https://phab.mercurial-scm.org/D8362
author Yuya Nishihara <yuya@tcha.org>
date Sun, 07 Oct 2018 10:23:57 +0900
parents bb936e25a84a
children 00ac60658654
line wrap: on
line diff
--- a/rust/chg/src/main.rs	Sun Oct 07 10:12:22 2018 +0900
+++ b/rust/chg/src/main.rs	Sun Oct 07 10:23:57 2018 +0900
@@ -73,14 +73,12 @@
 }
 
 fn run() -> io::Result<i32> {
-    let current_dir = env::current_dir()?;
     let loc = Locator::prepare_from_env()?;
     let handler = ChgUiHandler::new();
     let (result_tx, result_rx) = oneshot::channel();
     let fut = loc
         .connect()
-        .and_then(|(_, client)| client.set_current_dir(current_dir))
-        .and_then(|client| client.attach_io(io::stdin(), io::stdout(), io::stderr()))
+        .and_then(|(_, client)| client.attach_io(io::stdin(), io::stdout(), io::stderr()))
         .and_then(|client| {
             let pid = client.server_spec().process_id.unwrap();
             let pgid = client.server_spec().process_group_id;