Show More
@@ -6,8 +6,11 b'' | |||
|
6 | 6 | //! cHg extensions to command server client. |
|
7 | 7 | |
|
8 | 8 | use std::ffi::OsStr; |
|
9 | use std::os::unix::ffi::OsStrExt; | |
|
9 | 10 | use std::os::unix::io::AsRawFd; |
|
11 | use std::path::Path; | |
|
10 | 12 | use tokio_hglib::{Client, Connection}; |
|
13 | use tokio_hglib::protocol::OneShotRequest; | |
|
11 | 14 | |
|
12 | 15 | use super::attachio::AttachIo; |
|
13 | 16 | use super::message; |
@@ -23,6 +26,10 b' pub trait ChgClientExt<C>' | |||
|
23 | 26 | O: AsRawFd, |
|
24 | 27 | E: AsRawFd; |
|
25 | 28 | |
|
29 | /// Changes the working directory of the server. | |
|
30 | fn set_current_dir<P>(self, dir: P) -> OneShotRequest<C> | |
|
31 | where P: AsRef<Path>; | |
|
32 | ||
|
26 | 33 | /// Runs the specified Mercurial command with cHg extension. |
|
27 | 34 | fn run_command_chg<I, P, H>(self, handler: H, args: I) -> ChgRunCommand<C, H> |
|
28 | 35 | where I: IntoIterator<Item = P>, |
@@ -41,6 +48,12 b' impl<C> ChgClientExt<C> for Client<C>' | |||
|
41 | 48 | AttachIo::with_client(self, stdin, stdout, Some(stderr)) |
|
42 | 49 | } |
|
43 | 50 | |
|
51 | fn set_current_dir<P>(self, dir: P) -> OneShotRequest<C> | |
|
52 | where P: AsRef<Path>, | |
|
53 | { | |
|
54 | OneShotRequest::start_with_args(self, b"chdir", dir.as_ref().as_os_str().as_bytes()) | |
|
55 | } | |
|
56 | ||
|
44 | 57 | fn run_command_chg<I, P, H>(self, handler: H, args: I) -> ChgRunCommand<C, H> |
|
45 | 58 | where I: IntoIterator<Item = P>, |
|
46 | 59 | P: AsRef<OsStr>, |
General Comments 0
You need to be logged in to leave comments.
Login now