##// END OF EJS Templates
copy: add option to unmark file as copied...
copy: add option to unmark file as copied To unmark a file as copied, the user currently has to do this: hg forget <dest> hg add <dest> The new command simplifies that to: hg copy --forget <dest> That's not a very big improvement, but I'm planning to also teach `hg copy [--forget]` a `--at-rev` argument for marking/unmarking copies after commit (usually with `--at-rev .`). Differential Revision: https://phab.mercurial-scm.org/D8029

File last commit:

r44270:ce088b38 default
r44844:8be0c635 default
Show More
clientext.rs
72 lines | 2.0 KiB | application/rls-services+xml | RustLexer
Yuya Nishihara
rust-chg: add Client extensions to run cHg-specific requests...
r40013 // Copyright 2018 Yuya Nishihara <yuya@tcha.org>
//
// This software may be used and distributed according to the terms of the
// GNU General Public License version 2 or any later version.
//! cHg extensions to command server client.
use std::ffi::OsStr;
Yuya Nishihara
rust-chg: add interface to chdir the server
r40014 use std::os::unix::ffi::OsStrExt;
Yuya Nishihara
rust-chg: add Client extensions to run cHg-specific requests...
r40013 use std::os::unix::io::AsRawFd;
Yuya Nishihara
rust-chg: add interface to chdir the server
r40014 use std::path::Path;
Gregory Szorc
rust: run rustfmt...
r44270 use tokio_hglib::protocol::OneShotRequest;
Yuya Nishihara
rust-chg: add Client extensions to run cHg-specific requests...
r40013 use tokio_hglib::{Client, Connection};
use super::attachio::AttachIo;
use super::message;
use super::runcommand::ChgRunCommand;
use super::uihandler::SystemHandler;
pub trait ChgClientExt<C>
Gregory Szorc
rust: run rustfmt...
r44270 where
C: Connection + AsRawFd,
Yuya Nishihara
rust-chg: add Client extensions to run cHg-specific requests...
r40013 {
/// Attaches the client file descriptors to the server.
fn attach_io<I, O, E>(self, stdin: I, stdout: O, stderr: E) -> AttachIo<C, I, O, E>
Gregory Szorc
rust: run rustfmt...
r44270 where
I: AsRawFd,
O: AsRawFd,
E: AsRawFd;
Yuya Nishihara
rust-chg: add Client extensions to run cHg-specific requests...
r40013
Yuya Nishihara
rust-chg: add interface to chdir the server
r40014 /// Changes the working directory of the server.
fn set_current_dir<P>(self, dir: P) -> OneShotRequest<C>
Gregory Szorc
rust: run rustfmt...
r44270 where
P: AsRef<Path>;
Yuya Nishihara
rust-chg: add interface to chdir the server
r40014
Yuya Nishihara
rust-chg: add Client extensions to run cHg-specific requests...
r40013 /// Runs the specified Mercurial command with cHg extension.
fn run_command_chg<I, P, H>(self, handler: H, args: I) -> ChgRunCommand<C, H>
Gregory Szorc
rust: run rustfmt...
r44270 where
I: IntoIterator<Item = P>,
P: AsRef<OsStr>,
H: SystemHandler;
Yuya Nishihara
rust-chg: add Client extensions to run cHg-specific requests...
r40013 }
impl<C> ChgClientExt<C> for Client<C>
Gregory Szorc
rust: run rustfmt...
r44270 where
C: Connection + AsRawFd,
Yuya Nishihara
rust-chg: add Client extensions to run cHg-specific requests...
r40013 {
fn attach_io<I, O, E>(self, stdin: I, stdout: O, stderr: E) -> AttachIo<C, I, O, E>
Gregory Szorc
rust: run rustfmt...
r44270 where
I: AsRawFd,
O: AsRawFd,
E: AsRawFd,
Yuya Nishihara
rust-chg: add Client extensions to run cHg-specific requests...
r40013 {
AttachIo::with_client(self, stdin, stdout, Some(stderr))
}
Yuya Nishihara
rust-chg: add interface to chdir the server
r40014 fn set_current_dir<P>(self, dir: P) -> OneShotRequest<C>
Gregory Szorc
rust: run rustfmt...
r44270 where
P: AsRef<Path>,
Yuya Nishihara
rust-chg: add interface to chdir the server
r40014 {
OneShotRequest::start_with_args(self, b"chdir", dir.as_ref().as_os_str().as_bytes())
}
Yuya Nishihara
rust-chg: add Client extensions to run cHg-specific requests...
r40013 fn run_command_chg<I, P, H>(self, handler: H, args: I) -> ChgRunCommand<C, H>
Gregory Szorc
rust: run rustfmt...
r44270 where
I: IntoIterator<Item = P>,
P: AsRef<OsStr>,
H: SystemHandler,
Yuya Nishihara
rust-chg: add Client extensions to run cHg-specific requests...
r40013 {
ChgRunCommand::with_client(self, handler, message::pack_args_os(args))
}
}