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IXHUQBREIQC IOXNOVX2FJWPCEFVUHA5FEKIZJQT45R7VBAA43EPAKKVF5IWF4GAC XQDYES5MDSTFO7OPUPCRQLLQ6NAVELJOCCLSS6YE7TI6QDDFANDQC E7HE2UFTIOINUJQBRVCIG5GMANK6XWOYFX2ZHA73QJ6RW627G55QC DNTMUCMOH4BRNMQAVCHDM2XESAJIKWTZW344CVHOQIJBWXJWCOMAC SWWE2R6MVBX5CNM6X3WLXZTSRTU53PBJL7WJSFVF77XBPXDX4COAC 23SFYK4Q5NKBPJG53PQNPWQH6UOUU2YKJEL7RLXYBRLJOJYV7AWQC OPXFZKEBDHZZLXEJ2JRDYBOJH6YIN7UZNZYHVHMWMQVDTE2ZD53QC 6YZAVBWU6E5FYOI5JGEIPXGZLIKAW6LS2AOFIQWEE5DMOPPCD5PQC MsgIn::Push { channel } => {let result = push(&internal_state.path, &channel).await;let _ = msg_out_tx.send(MsgOut::Pushed { channel, result });
MsgIn::Push { remote, channel } => {let result = push(&internal_state.path, &remote, &channel).await;let _ = msg_out_tx.send(MsgOut::Pushed {remote,channel,result,});
match sub {model::SubState::PickingProject(state) => {picking_project(state, *window_size, allowed_actions, report)}model::SubState::PickingRepoDir(state) => {picking_repo_dir(state, *window_size, allowed_actions, report)
if let Some(sub) = sub_menu {match sub {model::SubMenu::Push {opt: Some(opt),remote,} => match opt {model::PushOption::SelectingRemote => {return push_selecting_remote(state,*window_size,allowed_actions,report,remote,sub_menu,);}},model::SubMenu::Push { opt: None, .. }| model::SubMenu::Pull| model::SubMenu::ResetChange| model::SubMenu::InitRepo { .. }| model::SubMenu::ImportFromGit { .. }| model::SubMenu::Add { .. }| model::SubMenu::CompareRemote { .. } => {}
}fn push_selecting_remote<'a>(state: &'a model::State,window_size: iced::Size,allowed_actions: &'a [action::Binding],report: &'a report::Container,remote: &'a Option<String>,sub_menu: &'a Option<model::SubMenu>,) -> Element<'a, Msg, Theme> {let main = if let model::SubState::ManagingRepo(state) = &state.sub&& let Some(model::ReadyState { repo, .. }) = model::is_ready(state){let repo::State {remotes: repo::Remotes { default, other },..} = repo;let mut cols = Vec::with_capacity(default.iter().len() + other.len());for name in default.iter().chain(other) {cols.push(el(button(text(name)).on_press_with(|| Msg::SubMenuPushSelectRemote(name.clone())).class(if Some(name) == remote.as_ref() {theme::Button::Selected} else {theme::Button::Normal})));}el(column(cols))} else {el(row([]))};let main = el(container(main).width(Length::Fill).height(Length::Fill));add_actions_and_report(None,main,window_size,allowed_actions,report,sub_menu,)
let actions_inner = above_actions.unwrap_or_else(|| column([]).spacing(4));
let mut actions_inner =above_actions.unwrap_or_else(|| column([]).spacing(4));if let Some(sub) = sub_menu {match sub {model::SubMenu::Push {opt: _,remote: Some(remote),} => {actions_inner =actions_inner.push(el(text(format!("Remote: {remote}"))));}model::SubMenu::Push { remote: None, .. }| model::SubMenu::Pull| model::SubMenu::ResetChange| model::SubMenu::InitRepo { .. }| model::SubMenu::ImportFromGit { .. }| model::SubMenu::Add { .. }| model::SubMenu::CompareRemote { .. } => {}}}
model::SubMenu::Push => {// TODO add optionsvec![Binding {keys_str: "Enter | S-p",keys: ModKeys::Two(ModKey {key: Key::Named(Named::Enter),
model::SubMenu::Push { remote: _, opt } => {if opt.is_none() {vec![Binding {keys_str: "Enter | S-p",keys: ModKeys::Two(ModKey {key: Key::Named(Named::Enter),mods: Mods::NONE,},ModKey {key: Key::Character("p".into()),mods: Mods::SHIFT,},),label: "confirm push",msg: Some(FilteredMsg::Confirm),},Binding {keys_str: "r",keys: ModKeys::One(ModKey {key: Key::Character("r".into()),
},ModKey {key: Key::Character("p".into()),mods: Mods::SHIFT,},),label: "confirm push",msg: Some(FilteredMsg::Confirm),},cancel(),]
}),label: "select remote",msg: Some(FilteredMsg::SubMenuPushOption(model::PushOption::SelectingRemote,)),},cancel(),]} else {vec![confirm("confirm remote selection"),down(),up(),cancel(),]}
Some(model::SubMenu::Push) => push(state, model, sub_menu),
Some(model::SubMenu::Push { remote, opt }) => {if opt.is_some() {*sub_menu = Some(model::SubMenu::Push {remote: remote.clone(),opt: None,});Task::none()} else {push(state, model, sub_menu, report, remote.clone())}}
if sub_menu.is_some() {
if let Some(sub) = sub_menu {match sub {model::SubMenu::Push { remote: _, opt } => {if opt.is_some() {*sub_menu = Some(model::SubMenu::Push {remote: None,opt: None,});}}model::SubMenu::Pull| model::SubMenu::ResetChange| model::SubMenu::InitRepo { .. }| model::SubMenu::ImportFromGit { .. }| model::SubMenu::Add { .. }| model::SubMenu::CompareRemote { .. } => {}}
if let Some(sub) = sub_menu {match sub {model::SubMenu::Push {remote,opt: Some(opt),} => {if let Some(ReadyState { repo, .. }) =model::is_ready_mut(model){return sub_menu_push_opt_selection(msg, remote, opt, repo,);}}model::SubMenu::Push { .. }| model::SubMenu::Pull| model::SubMenu::ResetChange| model::SubMenu::InitRepo { .. }| model::SubMenu::ImportFromGit { .. }| model::SubMenu::Add { .. }| model::SubMenu::CompareRemote { .. } => {}}}
}fn sub_menu_push_opt_selection(msg: selection::Msg,remote: &mut Option<String>,opt: &mut model::PushOption,repo: &mut repo::State,) -> Task<Msg> {let repo::Remotes { default, other } = &repo.remotes;let names: Vec<_> = default.iter().chain(other).collect();match opt {model::PushOption::SelectingRemote => match msg {selection::Msg::PressDir(dir) => match dir {selection::Dir::Down => {if let Some(current) = remote {let ix =names.iter().enumerate().find_map(|(ix, name)| {(*name == current).then_some(ix)});if let Some(ix) = ix&& ix < names.len().saturating_sub(1){*remote = names.into_iter().nth(ix + 1).cloned();return Task::none();}}*remote = names.into_iter().next().cloned();}selection::Dir::Up => {if let Some(current) = remote {let ix =names.iter().enumerate().find_map(|(ix, name)| {(*name == current).then_some(ix)});if let Some(ix) = ix&& ix > 0{*remote = names.into_iter().nth(ix - 1).cloned();return Task::none();}}*remote = names.into_iter().next_back().cloned();}selection::Dir::Right | selection::Dir::Left => {}},selection::Msg::AltPressDir(_) => {}},}Task::none()
jobs.insert(model::Job::Push {channel: repo.channel.clone(),});state.repo_tx_in.send(repo::MsgIn::Push {
if let Some(remote) =remote.clone().or_else(|| repo.remotes.default.clone()){jobs.insert(model::Job::Push {remote: remote.clone(),