D8403: rust-chg: indent process_message() to prepare mass rewrite to futures-0.3
yuja (Yuya Nishihara)
phabricator at mercurial-scm.org
Tue Apr 14 16:42:01 UTC 2020
Closed by commit rHGf87804825df5: rust-chg: indent process_message() to prepare mass rewrite to futures-0.3 (authored by yuja).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D8403?vs=21038&id=21074
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D8403/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D8403
AFFECTED FILES
rust/chg/src/runcommand.rs
CHANGE DETAILS
diff --git a/rust/chg/src/runcommand.rs b/rust/chg/src/runcommand.rs
--- a/rust/chg/src/runcommand.rs
+++ b/rust/chg/src/runcommand.rs
@@ -140,30 +140,31 @@
C: Connection,
H: SystemHandler,
{
- match msg {
- ChannelMessage::Data(b'r', data) => {
- let code = message::parse_result_code(data)?;
- Ok(AsyncS::Ready((client, handler, code)))
- }
- ChannelMessage::Data(..) => {
- // just ignores data sent to optional channel
- let msg_loop = MessageLoop::resume(client);
- Ok(AsyncS::PollAgain(CommandState::Running(msg_loop, handler)))
- }
- ChannelMessage::InputRequest(..) | ChannelMessage::LineRequest(..) => Err(io::Error::new(
- io::ErrorKind::InvalidData,
- "unsupported request",
- )),
- ChannelMessage::SystemRequest(data) => {
- let (cmd_type, cmd_spec) = message::parse_command_spec(data)?;
- match cmd_type {
- CommandType::Pager => {
- let fut = handler.spawn_pager(cmd_spec).into_future();
- Ok(AsyncS::PollAgain(CommandState::SpawningPager(client, fut)))
- }
- CommandType::System => {
- let fut = handler.run_system(cmd_spec).into_future();
- Ok(AsyncS::PollAgain(CommandState::WaitingSystem(client, fut)))
+ {
+ match msg {
+ ChannelMessage::Data(b'r', data) => {
+ let code = message::parse_result_code(data)?;
+ Ok(AsyncS::Ready((client, handler, code)))
+ }
+ ChannelMessage::Data(..) => {
+ // just ignores data sent to optional channel
+ let msg_loop = MessageLoop::resume(client);
+ Ok(AsyncS::PollAgain(CommandState::Running(msg_loop, handler)))
+ }
+ ChannelMessage::InputRequest(..) | ChannelMessage::LineRequest(..) => Err(
+ io::Error::new(io::ErrorKind::InvalidData, "unsupported request"),
+ ),
+ ChannelMessage::SystemRequest(data) => {
+ let (cmd_type, cmd_spec) = message::parse_command_spec(data)?;
+ match cmd_type {
+ CommandType::Pager => {
+ let fut = handler.spawn_pager(cmd_spec).into_future();
+ Ok(AsyncS::PollAgain(CommandState::SpawningPager(client, fut)))
+ }
+ CommandType::System => {
+ let fut = handler.run_system(cmd_spec).into_future();
+ Ok(AsyncS::PollAgain(CommandState::WaitingSystem(client, fut)))
+ }
}
}
}
To: yuja, #hg-reviewers, Alphare
Cc: Alphare, mercurial-devel
More information about the Mercurial-devel
mailing list