##// END OF EJS Templates
rust-chg: move set_current_dir() to Locator...
Yuya Nishihara -
r45163:0a2516ef default
parent child Browse files
Show More
@@ -20,6 +20,7 b' use tokio_hglib::UnixClient;'
20 20 use tokio_process::{Child, CommandExt};
21 21 use tokio_timer;
22 22
23 use super::clientext::ChgClientExt;
23 24 use super::message::ServerSpec;
24 25 use super::procutil;
25 26
@@ -80,6 +81,11 b' impl Locator {'
80 81 check_server_capabilities(client.server_spec())?;
81 82 Ok((loc, client))
82 83 })
84 .and_then(|(loc, client)| {
85 client
86 .set_current_dir(&loc.current_dir)
87 .map(|client| (loc, client))
88 })
83 89 }
84 90
85 91 /// Spawns new server process and connects to it.
@@ -73,14 +73,12 b' fn main() {'
73 73 }
74 74
75 75 fn run() -> io::Result<i32> {
76 let current_dir = env::current_dir()?;
77 76 let loc = Locator::prepare_from_env()?;
78 77 let handler = ChgUiHandler::new();
79 78 let (result_tx, result_rx) = oneshot::channel();
80 79 let fut = loc
81 80 .connect()
82 .and_then(|(_, client)| client.set_current_dir(current_dir))
83 .and_then(|client| client.attach_io(io::stdin(), io::stdout(), io::stderr()))
81 .and_then(|(_, client)| client.attach_io(io::stdin(), io::stdout(), io::stderr()))
84 82 .and_then(|client| {
85 83 let pid = client.server_spec().process_id.unwrap();
86 84 let pgid = client.server_spec().process_group_id;
General Comments 0
You need to be logged in to leave comments. Login now