rust/chg/src/locator.rs
changeset 44684 80d6e3415636
parent 44683 065048e66f32
child 44688 1f5ab1a9363d
--- a/rust/chg/src/locator.rs	Thu Oct 04 22:44:37 2018 +0900
+++ b/rust/chg/src/locator.rs	Mon Nov 19 20:50:45 2018 +0900
@@ -196,6 +196,17 @@
                 Ok((loc, client))
             })
             .and_then(|(loc, client)| {
+                // It's purely optional, and the server might not support this command.
+                if client.server_spec().capabilities.contains("setprocname") {
+                    let fut = client
+                        .set_process_name(format!("chg[worker/{}]", loc.process_id))
+                        .map(|client| (loc, client));
+                    Either::A(fut)
+                } else {
+                    Either::B(future::ok((loc, client)))
+                }
+            })
+            .and_then(|(loc, client)| {
                 client
                     .set_current_dir(&loc.current_dir)
                     .map(|client| (loc, client))