summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Dilly <dilly.stephan@gmail.com>2021-08-17 14:24:25 +0200
committerStephan Dilly <dilly.stephan@gmail.com>2021-08-17 14:24:25 +0200
commitdad8e8d43de79a3c39a37f118e529dc88fab5495 (patch)
tree32329a450106142d35374c88b776c74a679bd9a0
parent25a49e22f267f467fb7436c799e1d01294e0a914 (diff)
cargo fmt: use hardtabs
since it does not support hard-whitespaces its the only way to make whitespaces consisitent and checked
-rw-r--r--.vscode/settings.json1
-rw-r--r--asyncgit/src/asyncjob/mod.rs368
-rw-r--r--asyncgit/src/blame.rs312
-rw-r--r--asyncgit/src/cached/branchname.rs66
-rw-r--r--asyncgit/src/commit_files.rs180
-rw-r--r--asyncgit/src/diff.rs334
-rw-r--r--asyncgit/src/error.rs64
-rw-r--r--asyncgit/src/fetch.rs276
-rw-r--r--asyncgit/src/lib.rs92
-rw-r--r--asyncgit/src/progress.rs66
-rw-r--r--asyncgit/src/push.rs290
-rw-r--r--asyncgit/src/push_tags.rs264
-rw-r--r--asyncgit/src/remote_progress.rs240
-rw-r--r--asyncgit/src/remote_tags.rs100
-rw-r--r--asyncgit/src/revlog.rs356
-rw-r--r--asyncgit/src/status.rs280
-rw-r--r--asyncgit/src/sync/blame.rs376
-rw-r--r--asyncgit/src/sync/branch/merge_commit.rs466
-rw-r--r--asyncgit/src/sync/branch/merge_ff.rs236
-rw-r--r--asyncgit/src/sync/branch/merge_rebase.rs576
-rw-r--r--asyncgit/src/sync/branch/mod.rs1162
-rw-r--r--asyncgit/src/sync/branch/rename.rs92
-rw-r--r--asyncgit/src/sync/commit.rs460
-rw-r--r--asyncgit/src/sync/commit_details.rs236
-rw-r--r--asyncgit/src/sync/commit_files.rs270
-rw-r--r--asyncgit/src/sync/commits_info.rs328
-rw-r--r--asyncgit/src/sync/config.rs152
-rw-r--r--asyncgit/src/sync/cred.rs446
-rw-r--r--asyncgit/src/sync/diff.rs849
-rw-r--r--asyncgit/src/sync/hooks.rs498
-rw-r--r--asyncgit/src/sync/hunks.rs296
-rw-r--r--asyncgit/src/sync/ignore.rs248
-rw-r--r--asyncgit/src/sync/logwalker.rs412
-rw-r--r--asyncgit/src/sync/merge.rs144
-rw-r--r--asyncgit/src/sync/mod.rs504
-rw-r--r--asyncgit/src/sync/patches.rs84
-rw-r--r--asyncgit/src/sync/remotes/callbacks.rs404
-rw-r--r--asyncgit/src/sync/remotes/mod.rs338
-rw-r--r--asyncgit/src/sync/remotes/push.rs904
-rw-r--r--asyncgit/src/sync/remotes/tags.rs380
-rw-r--r--asyncgit/src/sync/reset.rs412
-rw-r--r--asyncgit/src/sync/staging/discard_tracked.rs442
-rw-r--r--asyncgit/src/sync/staging/mod.rs308
-rw-r--r--asyncgit/src/sync/staging/stage_tracked.rs270
-rw-r--r--asyncgit/src/sync/stash.rs474
-rw-r--r--asyncgit/src/sync/state.rs32
-rw-r--r--asyncgit/src/sync/status.rs230
-rw-r--r--asyncgit/src/sync/tags.rs284
-rw-r--r--asyncgit/src/sync/tree.rs402
-rw-r--r--asyncgit/src/sync/utils.rs608
-rw-r--r--asyncgit/src/tags.rs234
-rw-r--r--filetreelist/src/error.rs8
-rw-r--r--filetreelist/src/filetree.rs918
-rw-r--r--filetreelist/src/filetreeitems.rs1586
-rw-r--r--filetreelist/src/item.rs368
-rw-r--r--filetreelist/src/lib.rs16
-rw-r--r--filetreelist/src/tree_iter.rs44
-rw-r--r--filetreelist/src/treeitems_iter.rs84
-rw-r--r--invalidstring/src/lib.rs8
-rw-r--r--rustfmt.toml2
-rw-r--r--scopetime/src/lib.rs80
-rw-r--r--src/app.rs1614
-rw-r--r--src/args.rs164
-rw-r--r--src/bug_report.rs36
-rw-r--r--src/clipboard.rs86
-rw-r--r--src/cmdbar.rs368
-rw-r--r--src/components/blame_file.rs978
-rw-r--r--src/components/branchlist.rs1109
-rw-r--r--src/components/changes.rs556
-rw-r--r--src/components/command.rs134
-rw-r--r--src/components/commit.rs736
-rw-r--r--src/components/commit_details/details.rs952
-rw-r--r--src/components/commit_details/mod.rs368
-rw-r--r--src/components/commitlist.rs871
-rw-r--r--src/components/create_branch.rs308
-rw-r--r--src/components/cred.rs278
-rw-r--r--src/components/diff.rs1528
-rw-r--r--src/components/externaleditor.rs330
-rw-r--r--src/components/filetree.rs1050
-rw-r--r--src/components/help.rs446
-rw-r--r--src/components/inspect_commit.rs516
-rw-r--r--src/components/mod.rs234
-rw-r--r--src/components/msg.rs220
-rw-r--r--src/components/pull.rs490
-rw-r--r--src/components/push.rs558
-rw-r--r--src/components/push_tags.rs440
-rw-r--r--src/components/rename_branch.rs280
-rw-r--r--src/components/reset.rs240
-rw-r--r--src/components/revision_files.rs548
-rw-r--r--src/components/revision_files_popup.rs222
-rw-r--r--src/components/stashmsg.rs246
-rw-r--r--src/components/syntax_text.rs444
-rw-r--r--src/components/tag_commit.rs244
-rw-r--r--src/components/taglist.rs818
-rw-r--r--src/components/textinput.rs1022
-rw-r--r--src/components/utils/filetree.rs740
-rw-r--r--src/components/utils/logitems.rs144
-rw-r--r--src/components/utils/mod.rs64
-rw-r--r--src/components/utils/scroll_vertical.rs236
-rw-r--r--src/components/utils/statustree.rs1742
-rw-r--r--src/input.rs196
-rw-r--r--src/keys.rs400
-rw-r--r--src/main.rs422
-rw-r--r--src/notify_mutex.rs58
-rw-r--r--src/profiler.rs52
-rw-r--r--src/queue.rs164
-rw-r--r--src/spinner.rs80
-rw-r--r--src/strings.rs1872
-rw-r--r--src/tabs/files.rs182
-rw-r--r--src/tabs/revlog.rs664
-rw-r--r--src/tabs/stashing.rs438
-rw-r--r--src/tabs/stashlist.rs388
-rw-r--r--src/tabs/status.rs1396
-rw-r--r--src/ui/mod.rs174
-rw-r--r--src/ui/reflow.rs1217
-rw-r--r--src/ui/scrollbar.rs110
-rw-r--r--src/ui/scrolllist.rs112
-rw-r--r--src/ui/stateful_paragraph.rs346
-rw-r--r--src/ui/style.rs556
-rw-r--r--src/ui/syntax_text.rs302
-rw-r--r--src/version.rs46
121 files changed, 25246 insertions, 25249 deletions
diff --git a/.vscode/settings.json b/.vscode/settings.json
index a9c40cf5..bf7d5340 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,5 +1,4 @@
{
"editor.formatOnSave": true,
"workbench.settings.enableNaturalLanguageSearch": false,
- "telemetry.enableTelemetry": false,
} \ No newline at end of file
diff --git a/asyncgit/src/asyncjob/mod.rs b/asyncgit/src/asyncjob/mod.rs
index 3b48787c..161df802 100644
--- a/asyncgit/src/asyncjob/mod.rs
+++ b/asyncgit/src/asyncjob/mod.rs
@@ -8,202 +8,202 @@ use std::sync::{Arc, Mutex};
/// trait that defines an async task we can run on a threadpool
pub trait AsyncJob: Send + Sync + Clone {
- /// can run a synchronous time intensive task
- fn run(&mut self);
+ /// can run a synchronous time intensive task
+ fn run(&mut self);
}
/// Abstraction for a FIFO task queue that will only queue up **one** `next` job.
/// It keeps overwriting the next job until it is actually taken to be processed
#[derive(Debug, Clone)]
pub struct AsyncSingleJob<J: AsyncJob, T: Copy + Send + 'static> {
- next: Arc<Mutex<Option<J>>>,
- last: Arc<Mutex<Option<J>>>,
- sender: Sender<T>,
- pending: Arc<Mutex<()>>,
- notification: T,
+ next: Arc<Mutex<Option<J>>>,
+ last: Arc<Mutex<Option<J>>>,
+ sender: Sender<T>,
+ pending: Arc<Mutex<()>>,
+ notification: T,
}
impl<J: 'static + AsyncJob, T: Copy + Send + 'static>
- AsyncSingleJob<J, T>
+ AsyncSingleJob<J, T>
{
- ///
- pub fn new(sender: Sender<T>, value: T) -> Self {
- Self {
- next: Arc::new(Mutex::new(None)),
- last: Arc::new(Mutex::new(None)),
- pending: Arc::new(Mutex::new(())),
- notification: value,
- sender,
- }
- }
-
- ///
- pub fn is_pending(&self) -> bool {
- self.pending.try_lock().is_err()
- }
-
- /// makes sure `next` is cleared and returns `true` if it actually canceled something
- pub fn cancel(&mut self) -> bool {
- if let Ok(mut next) = self.next.lock() {
- if next.is_some() {
- *next = None;
- return true;
- }
- }
-
- false
- }
-
- /// take out last finished job
- pub fn take_last(&self) -> Option<J> {
- if let Ok(mut last) = self.last.lock() {
- last.take()
- } else {
- None
- }
- }
-
- /// spawns `task` if nothing is running currently, otherwise schedules as `next` overwriting if `next` was set before
- pub fn spawn(&mut self, task: J) -> bool {
- self.schedule_next(task);
- self.check_for_job()
- }
-
- fn check_for_job(&self) -> bool {
- if self.is_pending() {
- return false;
- }
-
- if let Some(task) = self.take_next() {
- let self_arc = self.clone();
-
- rayon_core::spawn(move || {
- if let Err(e) = self_arc.run_job(task) {
- log::error!("async job error: {}", e);
- }
- });
-
- return true;
- }
-
- false
- }
-
- fn run_job(&self, mut task: J) -> Result<()> {
- //limit the pending scope
- {
- let _pending = self.pending.lock()?;