merge uses

This commit is contained in:
Stephan Dilly 2020-05-19 23:11:28 +02:00
parent 8a1c03f97d
commit 1c03458de7
20 changed files with 46 additions and 46 deletions

View File

@ -1,5 +1,6 @@
use crate::error::Result;
use crate::{hash, sync, AsyncNotification, FileDiff, CWD};
use crate::{
error::Result, hash, sync, AsyncNotification, FileDiff, CWD,
};
use crossbeam_channel::Sender;
use log::trace;
use std::{

View File

@ -1,5 +1,4 @@
use crate::error::Result;
use crate::{sync, AsyncNotification, CWD};
use crate::{error::Result, sync, AsyncNotification, CWD};
use crossbeam_channel::Sender;
use git2::Oid;
use scopetime::scope_time;

View File

@ -1,5 +1,6 @@
use crate::{
error::Result, hash, sync, AsyncNotification, StatusItem, CWD,
error::Result, hash, sync, sync::status::StatusType,
AsyncNotification, StatusItem, CWD,
};
use crossbeam_channel::Sender;
use log::trace;
@ -10,7 +11,6 @@ use std::{
Arc, Mutex,
},
};
use sync::status::StatusType;
#[derive(Default, Hash, Clone)]
pub struct Status {

View File

@ -1,8 +1,7 @@
//! sync git api for fetching a diff
use super::utils;
use crate::error::Result;
use crate::{error::Error, hash};
use crate::{error::Error, error::Result, hash};
use git2::{
Delta, Diff, DiffDelta, DiffFormat, DiffHunk, DiffOptions, Patch,
Repository,

View File

@ -1,10 +1,10 @@
use crate::error::Result;
use scopetime::scope_time;
use std::fs::File;
use std::path::PathBuf;
use std::{
fs::File,
io::{Read, Write},
path::Path,
path::PathBuf,
process::Command,
};

View File

@ -2,8 +2,7 @@ use super::{
diff::{get_diff_raw, HunkHeader},
utils::repo,
};
use crate::error::Result;
use crate::{error::Error, hash};
use crate::{error::Error, error::Result, hash};
use git2::{ApplyLocation, ApplyOptions, Diff};
use log::error;
use scopetime::scope_time;

View File

@ -1,7 +1,6 @@
//! sync git api for fetching a status
use crate::error::Result;
use crate::{error::Error, sync::utils};
use crate::{error::Error, error::Result, sync::utils};
use git2::{Status, StatusOptions, StatusShow};
use scopetime::scope_time;
use std::path::Path;

View File

@ -1,4 +1,3 @@
use crate::ui::style::Theme;
use crate::{
accessors,
components::{
@ -10,6 +9,7 @@ use crate::{
queue::{InternalEvent, NeedsUpdate, Queue},
strings,
tabs::{Revlog, Status},
ui::style::Theme,
};
use asyncgit::{sync, AsyncNotification, CWD};
use crossbeam_channel::Sender;
@ -18,8 +18,7 @@ use itertools::Itertools;
use log::trace;
use std::borrow::Cow;
use strings::commands;
use tui::style::Style;
use tui::{
use tui::{style::Style,
backend::Backend,
layout::{Alignment, Constraint, Direction, Layout, Rect},
style::Modifier,

View File

@ -3,12 +3,12 @@ use super::{
statustree::{MoveSelection, StatusTree},
CommandBlocking, DrawableComponent,
};
use crate::ui::style::Theme;
use crate::{
components::{CommandInfo, Component},
keys,
queue::{InternalEvent, NeedsUpdate, Queue, ResetItem},
strings, ui,
ui::style::Theme,
};
use asyncgit::{hash, sync, StatusItem, StatusItemType, CWD};
use crossterm::event::Event;

View File

@ -2,11 +2,11 @@ use super::{
visibility_blocking, CommandBlocking, CommandInfo, Component,
DrawableComponent,
};
use crate::components::dialog_paragraph;
use crate::ui::style::Theme;
use crate::{
components::dialog_paragraph,
queue::{InternalEvent, NeedsUpdate, Queue},
strings, ui,
ui::style::Theme,
};
use asyncgit::{sync, CWD};
use crossterm::event::{Event, KeyCode};
@ -14,10 +14,10 @@ use log::error;
use std::borrow::Cow;
use strings::commands;
use sync::HookResult;
use tui::style::Style;
use tui::{
backend::Backend,
layout::Rect,
style::Style,
widgets::{Clear, Text},
Frame,
};

View File

@ -1,16 +1,15 @@
use super::{CommandBlocking, DrawableComponent, ScrollType};
use crate::ui::style::Theme;
use crate::{
components::{CommandInfo, Component},
keys,
queue::{InternalEvent, Queue},
strings,
ui::style::Theme,
};
use asyncgit::{hash, DiffLine, DiffLineType, FileDiff};
use crossterm::event::Event;
use std::{borrow::Cow, cmp, convert::TryFrom};
use strings::commands;
use tui::{
backend::Backend,
layout::{Alignment, Rect},

View File

@ -2,17 +2,16 @@ use super::{
visibility_blocking, CommandBlocking, CommandInfo, Component,
DrawableComponent,
};
use crate::ui::style::Theme;
use crate::{keys, strings, ui, version::Version};
use crate::{keys, strings, ui, ui::style::Theme, version::Version};
use asyncgit::hash;
use crossterm::event::Event;
use itertools::Itertools;
use std::{borrow::Cow, cmp, convert::TryFrom};
use strings::commands;
use tui::style::{Modifier, Style};
use tui::{
backend::Backend,
layout::{Alignment, Constraint, Direction, Layout, Rect},
style::{Modifier, Style},
widgets::{Block, Borders, Clear, Paragraph, Text},
Frame,
};

View File

@ -1,6 +1,3 @@
use crossterm::event::Event;
use tui::{backend::Backend, layout::Rect, Frame};
mod changes;
mod command;
mod commit;
@ -18,8 +15,15 @@ pub use filetree::FileTreeItemKind;
pub use help::HelpComponent;
pub use msg::MsgComponent;
pub use reset::ResetComponent;
use tui::layout::Alignment;
use tui::widgets::{Block, Borders, Paragraph, Text};
use crossterm::event::Event;
use tui::{
backend::Backend,
layout::Alignment,
layout::Rect,
widgets::{Block, Borders, Paragraph, Text},
Frame,
};
/// creates accessors for a list of components
///

View File

@ -2,8 +2,7 @@ use super::{
visibility_blocking, CommandBlocking, CommandInfo, Component,
DrawableComponent,
};
use crate::components::dialog_paragraph;
use crate::{keys, strings, ui};
use crate::{components::dialog_paragraph, keys, strings, ui};
use crossterm::event::Event;
use std::borrow::Cow;
use strings::commands;

View File

@ -3,12 +3,11 @@ use super::{
DrawableComponent,
};
use crate::{
components::dialog_paragraph,
queue::{InternalEvent, Queue, ResetItem},
strings, ui,
ui::style::Theme,
};
use crate::components::dialog_paragraph;
use crate::ui::style::Theme;
use crossterm::event::{Event, KeyCode};
use std::borrow::Cow;
use strings::commands;

View File

@ -25,17 +25,17 @@ use crossterm::{
},
ExecutableCommand, Result,
};
use io::Write;
use log::error;
use scopeguard::defer;
use scopetime::scope_time;
use simplelog::{Config, LevelFilter, WriteLogger};
use spinner::Spinner;
use std::path::PathBuf;
use std::{
env, fs,
fs::File,
io, panic,
io::{self, Write},
panic,
path::PathBuf,
time::{Duration, Instant},
};
use tui::{

View File

@ -1,6 +1,5 @@
mod utils;
use crate::ui::style::Theme;
use crate::{
components::{
CommandBlocking, CommandInfo, Component, DrawableComponent,
@ -9,6 +8,7 @@ use crate::{
keys,
strings::commands,
ui::calc_scroll_top,
ui::style::Theme,
};
use asyncgit::{sync, AsyncLog, AsyncNotification, CWD};
use crossbeam_channel::Sender;

View File

@ -1,4 +1,3 @@
use crate::ui::style::Theme;
use crate::{
accessors,
components::{
@ -9,6 +8,7 @@ use crate::{
keys,
queue::Queue,
strings,
ui::style::Theme,
};
use asyncgit::{
current_tick, AsyncDiff, AsyncNotification, AsyncStatus,

View File

@ -2,10 +2,10 @@ mod scrolllist;
pub(crate) mod style;
use crate::ui::style::Theme;
use scrolllist::ScrollableList;
use tui::style::Modifier;
use tui::{
backend::Backend,
layout::{Constraint, Direction, Layout, Rect},
style::Modifier,
widgets::{Block, Borders, Text},
Frame,
};

View File

@ -1,11 +1,15 @@
use crate::get_app_config_path;
use asyncgit::{DiffLineType, StatusItemType};
use ron::de::from_bytes;
use ron::ser::{to_string_pretty, PrettyConfig};
use ron::{
de::from_bytes,
ser::{to_string_pretty, PrettyConfig},
};
use serde::{Deserialize, Serialize};
use std::fs::File;
use std::io::{Read, Write};
use std::path::PathBuf;
use std::{
fs::File,
io::{Read, Write},
};
use tui::style::{Color, Modifier, Style};
#[derive(Serialize, Deserialize, Debug, Clone, Copy)]