rust/edition/fmt: 2021 → 2024

Reformat code with `rustfmt`, now that the edition changed from
Rust 2021 to Rust 2024.
This commit is contained in:
Lorenz Leutgeb 2026-03-25 08:24:30 +01:00
parent 0494227e75
commit 8bac24d6ab
No known key found for this signature in database
234 changed files with 784 additions and 689 deletions

View File

@ -1 +1 @@
edition = "2021"
edition = "2024"

View File

@ -3,13 +3,13 @@ mod args;
use std::str::FromStr;
use anyhow::{anyhow, Context};
use anyhow::{Context, anyhow};
use radicle::crypto::ssh;
use radicle::crypto::ssh::Passphrase;
use radicle::node::Alias;
use radicle::profile::env;
use radicle::{profile, Profile};
use radicle::{Profile, profile};
use crate::terminal as term;

View File

@ -16,8 +16,8 @@ pub struct Args {
#[cfg(test)]
mod test {
use clap::error::ErrorKind;
use clap::Parser;
use clap::error::ErrorKind;
use super::Args;

View File

@ -3,8 +3,8 @@ mod args;
use std::path::PathBuf;
use anyhow::anyhow;
use anyhow::Context as _;
use anyhow::anyhow;
use radicle::git;
use radicle::node::AliasStore;

View File

@ -2,15 +2,15 @@ use std::path::PathBuf;
use clap::Parser;
use radicle::identity::doc::RepoId;
use radicle::identity::IdError;
use radicle::identity::doc::RepoId;
use radicle::node::policy::Scope;
use radicle::prelude::*;
use radicle::storage::refs;
use crate::common_args::{
SignedReferencesFeatureLevel, SignedReferencesFeatureLevelParser,
ABOUT_FETCH_SIGNED_REFERENCES_FEATURE_LEVEL_MINIMUM,
ABOUT_FETCH_SIGNED_REFERENCES_FEATURE_LEVEL_MINIMUM, SignedReferencesFeatureLevel,
SignedReferencesFeatureLevelParser,
};
use crate::node::SyncSettings;
use crate::terminal;

View File

@ -21,7 +21,7 @@ use crate::terminal as term;
pub use args::Args;
use args::{parse_many_embeds, FilteredTypeName, Format};
use args::{FilteredTypeName, Format, parse_many_embeds};
fn embeds(
repo: &storage::git::Repository,

View File

@ -339,8 +339,8 @@ impl std::str::FromStr for FilteredTypeName {
#[cfg(test)]
mod test {
use super::Args;
use clap::error::ErrorKind;
use clap::Parser;
use clap::error::ErrorKind;
const ARGS: &[&str] = &[
"--repo",

View File

@ -5,7 +5,7 @@ use args::Command;
use std::path::Path;
use radicle::profile::{config, Config, ConfigPath, RawConfig};
use radicle::profile::{Config, ConfigPath, RawConfig, config};
use crate::terminal as term;
use crate::terminal::Element as _;

View File

@ -1,7 +1,7 @@
mod args;
use radicle::node::{policy, Alias, AliasStore, Handle, NodeId};
use radicle::{prelude::*, Node};
use radicle::node::{Alias, AliasStore, Handle, NodeId, policy};
use radicle::{Node, prelude::*};
use radicle_term::{Element as _, Paint, Table};
use crate::terminal as term;

View File

@ -25,8 +25,8 @@ pub struct Args {
#[cfg(test)]
mod test {
use super::Args;
use clap::error::ErrorKind;
use clap::Parser;
use clap::error::ErrorKind;
#[test]
fn should_parse_rid_non_urn() {

View File

@ -2,21 +2,21 @@ mod args;
use std::collections::BTreeSet;
use anyhow::{anyhow, Context};
use anyhow::{Context, anyhow};
use radicle::cob::identity::{self, IdentityMut, Revision, RevisionId};
use radicle::cob::Title;
use radicle::cob::identity::{self, IdentityMut, Revision, RevisionId};
use radicle::identity::doc::update;
use radicle::identity::{doc, Doc, Identity, RawDoc};
use radicle::node::device::Device;
use radicle::identity::{Doc, Identity, RawDoc, doc};
use radicle::node::NodeId;
use radicle::node::device::Device;
use radicle::storage::{ReadStorage as _, WriteRepository};
use radicle::{cob, crypto, Profile};
use radicle::{Profile, cob, crypto};
use radicle_surf::diff::Diff;
use radicle_term::Element;
use crate::git::unified_diff::Encode as _;
use crate::git::Rev;
use crate::git::unified_diff::Encode as _;
use crate::terminal as term;
use crate::terminal::args::Error;
use crate::terminal::format::Author;

View File

@ -8,9 +8,9 @@ use serde_json as json;
use thiserror::Error;
use radicle::cob::{Title, TypeNameParse};
use radicle::identity::doc::PayloadId;
use radicle::identity::doc::update::EditVisibility;
use radicle::identity::doc::update::PayloadUpsert;
use radicle::identity::doc::PayloadId;
use radicle::prelude::{Did, RepoId};
use crate::git::Rev;
@ -240,9 +240,9 @@ pub(super) enum Command {
#[cfg(test)]
mod test {
use super::{parse_many_upserts, Args};
use clap::error::ErrorKind;
use super::{Args, parse_many_upserts};
use clap::Parser;
use clap::error::ErrorKind;
#[test]
fn should_parse_single_payload() {

View File

@ -9,8 +9,8 @@ use anyhow::anyhow;
use localtime::LocalTime;
use radicle::cob::TypedId;
use radicle::git::fmt::Qualified;
use radicle::git::BranchName;
use radicle::git::fmt::Qualified;
use radicle::identity::Identity;
use radicle::issue::cache::Issues as _;
use radicle::node::notifications;
@ -18,7 +18,7 @@ use radicle::node::notifications::*;
use radicle::patch::cache::Patches as _;
use radicle::prelude::{NodeId, Profile, RepoId};
use radicle::storage::{ReadRepository, ReadStorage};
use radicle::{cob, git, Storage};
use radicle::{Storage, cob, git};
use term::Element as _;

View File

@ -10,7 +10,7 @@ use std::convert::TryFrom;
use std::env;
use std::str::FromStr;
use anyhow::{anyhow, bail, Context as _};
use anyhow::{Context as _, anyhow, bail};
use serde_json as json;
use radicle::crypto::ssh;
@ -21,9 +21,9 @@ use radicle::git::raw::ErrorExt as _;
use radicle::identity::project::ProjectName;
use radicle::identity::{Doc, RepoId, Visibility};
use radicle::node::events::UploadPack;
use radicle::node::{Event, Handle, NodeId, DEFAULT_SUBSCRIBE_TIMEOUT};
use radicle::node::{DEFAULT_SUBSCRIBE_TIMEOUT, Event, Handle, NodeId};
use radicle::storage::ReadStorage as _;
use radicle::{profile, Node};
use radicle::{Node, profile};
use crate::commands;
use crate::git;
@ -63,7 +63,9 @@ pub fn init(repo: git::Repository, args: Args, profile: &profile::Profile) -> an
let default_branch = match find_default_branch(&repo) {
Err(err @ DefaultBranchError::Head) => {
term::error(err);
term::hint("try `git checkout <default branch>` or set `git config set --local init.defaultBranch <default branch>`");
term::hint(
"try `git checkout <default branch>` or set `git config set --local init.defaultBranch <default branch>`",
);
anyhow::bail!("aborting `rad init`")
}
Err(err @ DefaultBranchError::NoHead) => {
@ -209,7 +211,9 @@ pub fn init(repo: git::Repository, args: Args, profile: &profile::Profile) -> an
term::warning(format!(
"There was an error announcing your repository to the network: {e}"
));
term::warning("Try again with `rad sync --announce`, or check your logs with `rad node logs`.");
term::warning(
"Try again with `rad sync --announce`, or check your logs with `rad node logs`.",
);
term::blank();
}
term::info!("To push changes, run {}.", term::format::command(push_cmd));
@ -445,7 +449,8 @@ pub fn announce(
term::blank();
term::info!(
"You are not connected to any peers. Your repository will be announced as soon as \
your node establishes a connection with the network.");
your node establishes a connection with the network."
);
term::info!("Check for peer connections with `rad node status`.");
term::blank();
}

View File

@ -2,7 +2,7 @@ use std::path::PathBuf;
use clap::Parser;
use radicle::{
identity::{project::ProjectName, Visibility},
identity::{Visibility, project::ProjectName},
node::policy::Scope,
prelude::RepoId,
};
@ -115,8 +115,8 @@ impl clap::builder::TypedValueParser for ScopeParser {
#[cfg(test)]
mod test {
use super::Args;
use clap::error::ErrorKind;
use clap::Parser;
use clap::error::ErrorKind;
#[test]
fn should_parse_rid_non_urn() {

View File

@ -11,15 +11,15 @@ use chrono::prelude::*;
use radicle::identity::RepoId;
use radicle::identity::{DocAt, Identity};
use radicle::node::policy::SeedingPolicy;
use radicle::node::AliasStore as _;
use radicle::node::policy::SeedingPolicy;
use radicle::storage::git::{Repository, Storage};
use radicle::storage::refs::{FeatureLevel, RefsAt, SignedRefs};
use radicle::storage::{ReadRepository, ReadStorage};
use crate::terminal as term;
use crate::terminal::json;
use crate::terminal::Element;
use crate::terminal::json;
pub use args::Args;
use args::Target;

View File

@ -6,18 +6,18 @@ use anyhow::Context as _;
use radicle::cob::common::Label;
use radicle::cob::issue::{CloseReason, State};
use radicle::cob::{issue, Title};
use radicle::cob::{Title, issue};
use radicle::Profile;
use radicle::crypto;
use radicle::issue::cache::Issues as _;
use radicle::node::device::Device;
use radicle::node::NodeId;
use radicle::node::device::Device;
use radicle::prelude::Did;
use radicle::profile;
use radicle::storage;
use radicle::storage::{WriteRepository, WriteStorage};
use radicle::Profile;
use radicle::{cob, Node};
use radicle::{Node, cob};
pub use args::Args;
use args::{Assigned, Command, CommentAction, StateArg};
@ -25,10 +25,10 @@ use args::{Assigned, Command, CommentAction, StateArg};
use crate::git::Rev;
use crate::node;
use crate::terminal as term;
use crate::terminal::Element;
use crate::terminal::args::Error;
use crate::terminal::format::Author;
use crate::terminal::issue::Format;
use crate::terminal::Element;
const ABOUT: &str = "Manage issues";

View File

@ -4,7 +4,7 @@ use clap::{Parser, Subcommand};
use radicle::{
cob::{Label, Reaction, Title},
identity::{did::DidError, Did, RepoId},
identity::{Did, RepoId, did::DidError},
issue::{CloseReason, State},
};

View File

@ -1,9 +1,9 @@
use std::ops::ControlFlow;
use radicle::issue::IssueId;
use radicle::storage::git::Repository;
use radicle::storage::ReadStorage as _;
use radicle::Profile;
use radicle::issue::IssueId;
use radicle::storage::ReadStorage as _;
use radicle::storage::git::Repository;
use crate::terminal as term;

View File

@ -1,12 +1,12 @@
use radicle::Profile;
use radicle::cob::thread;
use radicle::storage::WriteRepository;
use radicle::Profile;
use radicle::{cob, git, issue, storage};
use crate::git::Rev;
use crate::terminal as term;
use crate::terminal::patch::Message;
use crate::terminal::Element as _;
use crate::terminal::patch::Message;
pub(super) fn comment(
profile: &Profile,

View File

@ -7,11 +7,11 @@ pub mod routing;
use std::{process, time};
use radicle::node::Handle as _;
use radicle::node::Node;
use radicle::node::address::Store as AddressStore;
use radicle::node::config::ConnectAddress;
use radicle::node::routing::Store;
use radicle::node::Handle as _;
use radicle::node::Node;
use crate::commands::node::args::Only;
use crate::terminal as term;

View File

@ -4,14 +4,14 @@ use std::fs::File;
use std::io::{BufRead, BufReader, Read, Seek, SeekFrom, Write};
use std::{path::Path, process, thread, time};
use anyhow::{anyhow, Context};
use anyhow::{Context, anyhow};
use localtime::LocalTime;
use radicle::Node;
use radicle::node;
use radicle::node::{Address, ConnectResult, Handle as _, NodeId};
use radicle::profile::env::RAD_PASSPHRASE;
use radicle::Node;
use radicle::{profile, Profile};
use radicle::{Profile, profile};
use crate::commands::node::logs::{LogRotatorFileSystem, Rotated};
use crate::terminal as term;

View File

@ -22,10 +22,10 @@ use std::collections::BTreeSet;
use anyhow::anyhow;
use radicle::cob::patch::PatchId;
use radicle::cob::{patch, Label};
use radicle::cob::{Label, patch};
use radicle::patch::cache::Patches as _;
use radicle::storage::git::transport;
use radicle::{prelude::*, Node};
use radicle::{Node, prelude::*};
use crate::git::Rev;
use crate::node;

View File

@ -1,9 +1,9 @@
use std::ops::ControlFlow;
use radicle::patch::PatchId;
use radicle::storage::git::Repository;
use radicle::storage::ReadStorage as _;
use radicle::Profile;
use radicle::patch::PatchId;
use radicle::storage::ReadStorage as _;
use radicle::storage::git::Repository;
use crate::terminal as term;

View File

@ -5,10 +5,10 @@ use radicle::cob::patch::RevisionId;
use radicle::git::fmt::Qualified;
use radicle::git::fmt::RefString;
use radicle::git::raw::ErrorExt as _;
use radicle::patch::cache::Patches as _;
use radicle::patch::PatchId;
use radicle::patch::cache::Patches as _;
use radicle::storage::git::Repository;
use radicle::{git, rad, Profile};
use radicle::{Profile, git, rad};
use crate::terminal as term;

View File

@ -1,12 +1,12 @@
use anyhow::anyhow;
use radicle::Profile;
use radicle::cob;
use radicle::cob::patch;
use radicle::cob::thread;
use radicle::patch::cache::Patches as _;
use radicle::patch::ByRevision;
use radicle::patch::cache::Patches as _;
use radicle::storage::git::Repository;
use radicle::Profile;
use crate::git;
use crate::terminal as term;

View File

@ -1,13 +1,13 @@
use anyhow::anyhow;
use radicle::Profile;
use radicle::cob;
use radicle::cob::Reaction;
use radicle::cob::patch;
use radicle::cob::thread;
use radicle::cob::Reaction;
use radicle::patch::cache::Patches as _;
use radicle::patch::ByRevision;
use radicle::patch::cache::Patches as _;
use radicle::storage::git::Repository;
use radicle::Profile;
use crate::git;
use crate::terminal as term;

View File

@ -1,12 +1,12 @@
use anyhow::anyhow;
use radicle::Profile;
use radicle::cob;
use radicle::cob::patch;
use radicle::cob::thread;
use radicle::patch::cache::Patches as _;
use radicle::patch::ByRevision;
use radicle::patch::cache::Patches as _;
use radicle::storage::git::Repository;
use radicle::Profile;
use crate::git;
use crate::terminal as term;

View File

@ -1,8 +1,8 @@
use super::*;
use radicle::cob;
use radicle::cob::patch;
use radicle::cob::Title;
use radicle::cob::patch;
use radicle::crypto;
use radicle::node::device::Device;
use radicle::prelude::*;

View File

@ -7,9 +7,9 @@ use radicle::prelude::*;
use radicle::profile::Profile;
use radicle::storage::git::Repository;
use term::Element as _;
use term::format::Author;
use term::table::{Table, TableOptions};
use term::Element as _;
use crate::terminal as term;
use crate::terminal::patch as common;

View File

@ -1,11 +1,11 @@
use anyhow::anyhow;
use radicle::cob;
use radicle::cob::{patch, Reaction};
use radicle::patch::cache::Patches as _;
use radicle::patch::ByRevision;
use radicle::storage::git::Repository;
use radicle::Profile;
use radicle::cob;
use radicle::cob::{Reaction, patch};
use radicle::patch::ByRevision;
use radicle::patch::cache::Patches as _;
use radicle::storage::git::Repository;
use crate::git;
use crate::terminal as term;

View File

@ -1,9 +1,9 @@
use anyhow::anyhow;
use radicle::Profile;
use radicle::cob::thread::CommentId;
use radicle::patch::{self, PatchId};
use radicle::patch::{cache::Patches as _, ReviewId};
use radicle::patch::{ReviewId, cache::Patches as _};
use radicle::storage::git::Repository;
use radicle::Profile;
use crate::terminal as term;

View File

@ -1,6 +1,6 @@
mod builder;
use anyhow::{anyhow, Context};
use anyhow::{Context, anyhow};
use radicle::cob::patch::{PatchId, RevisionId, Verdict};
use radicle::git;

View File

@ -26,7 +26,7 @@ use radicle::git;
use radicle::git::Oid;
use radicle::node::device::Device;
use radicle::prelude::*;
use radicle::storage::git::{cob::DraftStore, Repository};
use radicle::storage::git::{Repository, cob::DraftStore};
use radicle_surf::diff::*;
use radicle_term::{Element, VStack};

View File

@ -1,6 +1,6 @@
mod args;
use anyhow::{anyhow, Context as _};
use anyhow::{Context as _, anyhow};
use radicle::cob;
use radicle::identity::{Identity, Visibility};

View File

@ -27,8 +27,8 @@ pub struct Args {
#[cfg(test)]
mod test {
use super::Args;
use clap::error::ErrorKind;
use clap::Parser;
use clap::error::ErrorKind;
#[test]
fn should_parse_rid_non_urn() {

View File

@ -1,9 +1,9 @@
use std::str::FromStr;
use radicle::Profile;
use radicle::git;
use radicle::git::fmt::RefString;
use radicle::prelude::*;
use radicle::Profile;
use radicle_crypto::PublicKey;
use crate::commands::checkout;

View File

@ -1,10 +1,10 @@
use std::collections::HashSet;
use radicle::Profile;
use radicle::git::Url;
use radicle::identity::{Did, RepoId};
use radicle::node::{Alias, AliasStore as _, NodeId};
use radicle::storage::ReadStorage as _;
use radicle::Profile;
use radicle_term::{Element, Table};
use crate::git;

View File

@ -1,9 +1,9 @@
mod args;
use radicle::node::Handle;
use radicle::node::policy;
use radicle::node::policy::{Policy, Scope};
use radicle::node::Handle;
use radicle::{prelude::*, Node};
use radicle::{Node, prelude::*};
use radicle_term::Element as _;
use crate::commands::sync;

View File

@ -5,13 +5,13 @@ use std::collections::BTreeMap;
use std::collections::HashSet;
use std::time;
use anyhow::{anyhow, Context as _};
use anyhow::{Context as _, anyhow};
use radicle::node;
use radicle::node::SyncedAt;
use radicle::node::address::Store;
use radicle::node::sync;
use radicle::node::sync::fetch::SuccessfulOutcome;
use radicle::node::SyncedAt;
use radicle::node::{AliasStore, Handle as _, Node, Seed, SyncStatus};
use radicle::prelude::{NodeId, Profile, RepoId};
use radicle::storage::ReadRepository;

View File

@ -4,14 +4,14 @@ use std::time;
use clap::{Parser, Subcommand, ValueEnum};
use radicle::{
node::{sync, NodeId},
node::{NodeId, sync},
prelude::RepoId,
storage::refs,
};
use crate::common_args::{
SignedReferencesFeatureLevel, SignedReferencesFeatureLevelParser,
ABOUT_FETCH_SIGNED_REFERENCES_FEATURE_LEVEL_MINIMUM,
ABOUT_FETCH_SIGNED_REFERENCES_FEATURE_LEVEL_MINIMUM, SignedReferencesFeatureLevel,
SignedReferencesFeatureLevelParser,
};
use crate::node::SyncSettings;

View File

@ -1,6 +1,6 @@
pub mod args;
use radicle::{prelude::*, Node};
use radicle::{Node, prelude::*};
use crate::terminal as term;

View File

@ -2,7 +2,7 @@ mod args;
use std::{thread, time};
use anyhow::{anyhow, Context as _};
use anyhow::{Context as _, anyhow};
use radicle::git;
use radicle::git::raw::ErrorExt as _;

View File

@ -14,21 +14,21 @@ use std::path::{Path, PathBuf};
use std::process::Command;
use std::str::FromStr;
use anyhow::anyhow;
use anyhow::Context as _;
use anyhow::anyhow;
use thiserror::Error;
use radicle::crypto::ssh;
use radicle::git;
use radicle::git::{Version, VERSION_REQUIRED};
use radicle::git::{VERSION_REQUIRED, Version};
use radicle::prelude::{NodeId, RepoId};
use radicle::storage::git::transport;
pub use radicle::git::Oid;
pub use radicle::git::raw::{
build::CheckoutBuilder, AnnotatedCommit, Commit, Direction, ErrorCode, ErrorExt as _,
MergeAnalysis, MergeOptions, Reference, Repository, Signature,
AnnotatedCommit, Commit, Direction, ErrorCode, ErrorExt as _, MergeAnalysis, MergeOptions,
Reference, Repository, Signature, build::CheckoutBuilder,
};
pub const CONFIG_COMMIT_GPG_SIGN: &str = "commit.gpgsign";

View File

@ -305,7 +305,7 @@ impl unified_diff::Decode for DiffModification {
(v1, v2) => {
return Err(unified_diff::Error::syntax(format!(
"indicator character expected, but got '{v1}{v2}'"
)))
)));
}
};

View File

@ -7,8 +7,8 @@ use radicle_surf::diff;
use radicle_surf::diff::{Added, Copied, Deleted, FileStats, Hunks, Modified, Moved};
use radicle_surf::diff::{Diff, DiffContent, FileDiff, Hunk, Modification};
use radicle_term as term;
use term::cell::Cell;
use term::VStack;
use term::cell::Cell;
use crate::git::unified_diff::FileHeader;
use crate::terminal::highlight::{Highlighter, Theme};

View File

@ -533,7 +533,7 @@ impl Decode for Modification {
Some(c) => {
return Err(Error::syntax(format!(
"indicator character expected, but got '{c}'",
)))
)));
}
None => return Err(Error::UnexpectedEof),
};

View File

@ -5,8 +5,8 @@ use std::io::Write;
use std::{io::ErrorKind, process};
use anyhow::anyhow;
use clap::builder::styling::AnsiColor;
use clap::builder::Styles;
use clap::builder::styling::AnsiColor;
use clap::{CommandFactory as _, Parser, Subcommand};
use radicle::version::Version;

View File

@ -4,7 +4,7 @@ use std::io::Write;
use radicle::node::sync;
use radicle::node::{Handle as _, NodeId};
use radicle::storage::{refs, ReadRepository, RepositoryError};
use radicle::storage::{ReadRepository, RepositoryError, refs};
use radicle::{Node, Profile};
use crate::terminal as term;
@ -136,7 +136,9 @@ pub fn announce<R: ReadRepository>(
match announce_(repo, settings, reporting, node, profile) {
Ok(result) => Ok(result),
Err(e) if e.is_connection_err() => {
term::hint("Node is stopped. To announce changes to the network, start it with `rad node start`.");
term::hint(
"Node is stopped. To announce changes to the network, start it with `rad node start`.",
);
Ok(None)
}
Err(e) => Err(e),

View File

@ -32,7 +32,9 @@ pub(crate) enum BlockTarget {
}
#[derive(Debug, Error)]
#[error("invalid repository or node specified (RID parsing failed with: '{repo}', NID parsing failed with: '{node}'))")]
#[error(
"invalid repository or node specified (RID parsing failed with: '{repo}', NID parsing failed with: '{node}'))"
)]
pub(crate) struct BlockTargetParseError {
repo: radicle::identity::IdError,
node: radicle::crypto::PublicKeyError,
@ -62,7 +64,9 @@ impl std::fmt::Display for BlockTarget {
}
#[derive(Debug, thiserror::Error)]
#[error("invalid Node ID specified (Node ID parsing failed with: '{nid}', DID parsing failed with: '{did}'))")]
#[error(
"invalid Node ID specified (Node ID parsing failed with: '{nid}', DID parsing failed with: '{did}'))"
)]
pub(crate) struct NodeIdParseError {
did: radicle::identity::did::DidError,
nid: radicle::crypto::PublicKeyError,

View File

@ -1,4 +1,5 @@
use radicle::{
Profile,
cob::{
self,
cache::{MigrateCallback, MigrateProgress},
@ -6,7 +7,6 @@ use radicle::{
prelude::NodeId,
profile,
storage::ReadRepository,
Profile,
};
use radicle_term as term;

View File

@ -1,5 +1,5 @@
use radicle::cob::thread::{Comment, CommentId};
use radicle::Profile;
use radicle::cob::thread::{Comment, CommentId};
use crate::terminal as term;
use crate::terminal::format::Author;

View File

@ -3,14 +3,14 @@ use std::fmt;
use localtime::LocalTime;
pub use radicle_term::format::*;
pub use radicle_term::{style, Paint};
pub use radicle_term::{Paint, style};
use radicle::cob::ObjectId;
use radicle::identity::Visibility;
use radicle::node::policy::Policy;
use radicle::node::{Alias, AliasStore, NodeId};
use radicle::prelude::Did;
use radicle::profile::{env, Profile};
use radicle::profile::{Profile, env};
use radicle::storage::RefUpdate;
use radicle_term::element::Line;

View File

@ -1,12 +1,12 @@
use anyhow::anyhow;
use radicle::cob::Reaction;
use radicle::cob::issue::Issue;
use radicle::cob::thread::{Comment, CommentId};
use radicle::cob::Reaction;
use radicle::crypto::ssh::keystore::MemorySigner;
use radicle::crypto::ssh::Keystore;
use radicle::crypto::ssh::keystore::MemorySigner;
use radicle::node::device::{BoxedDevice, Device};
use radicle::profile::env::RAD_PASSPHRASE;
use radicle::profile::Profile;
use radicle::profile::env::RAD_PASSPHRASE;
pub use radicle_term::io::*;
pub use radicle_term::spinner;

View File

@ -3,14 +3,14 @@ use std::io;
use radicle_term::table::TableOptions;
use radicle_term::{Table, VStack};
use radicle::Profile;
use radicle::cob;
use radicle::cob::issue;
use radicle::cob::issue::CloseReason;
use radicle::Profile;
use crate::terminal as term;
use crate::terminal::format::Author;
use crate::terminal::Element;
use crate::terminal::format::Author;
pub const OPEN_MSG: &str = r#"
<!--

View File

@ -9,13 +9,13 @@ use std::io::IsTerminal as _;
use thiserror::Error;
use radicle::cob;
use radicle::cob::patch;
use radicle::cob::Title;
use radicle::cob::patch;
use radicle::git;
use radicle::patch::{Patch, PatchId};
use radicle::prelude::Profile;
use radicle::storage::git::Repository;
use radicle::storage::WriteRepository as _;
use radicle::storage::git::Repository;
use crate::terminal as term;
use crate::terminal::Element;

View File

@ -1,8 +1,8 @@
use std::collections::HashMap;
use std::sync::LazyLock;
use radicle::node::config::ConnectAddress;
use radicle::node::Address;
use radicle::node::config::ConnectAddress;
use radicle::profile::Config;
static NODES_RENAMED: LazyLock<HashMap<Address, Address>> = LazyLock::new(|| {

View File

@ -1,10 +1,10 @@
use crate::test;
use crate::util::environment::Environment;
use radicle::node;
use radicle::node::UserAgent;
use radicle::node::address::Store as _;
use radicle::node::policy::Scope;
use radicle::node::routing::Store as _;
use radicle::node::UserAgent;
use radicle::node::{Alias, Handle as _};
use radicle::prelude::{NodeId, RepoId};
use radicle::storage::ReadStorage as _;

View File

@ -1,9 +1,9 @@
use crate::test;
use crate::util::environment::Environment;
use crate::util::formula::formula;
use radicle::node::policy::Scope;
use radicle::node::Event;
use radicle::node::DEFAULT_TIMEOUT;
use radicle::node::Event;
use radicle::node::policy::Scope;
use radicle::node::{Alias, Handle as _};
use radicle::prelude::RepoId;
use radicle::storage::ReadStorage as _;

View File

@ -1,9 +1,9 @@
use crate::test;
use crate::util::environment::Environment;
use radicle::node::address::Store as _;
use radicle::node::config::DefaultSeedingPolicy;
use radicle::node::Address;
use radicle::node::UserAgent;
use radicle::node::address::Store as _;
use radicle::node::config::DefaultSeedingPolicy;
use radicle::node::{Alias, Handle as _};
use radicle::test::fixtures;
use radicle_localtime::LocalTime;

View File

@ -1,8 +1,8 @@
use crate::test;
use crate::util::environment::Environment;
use crate::util::formula::formula;
use radicle::node::policy::Scope;
use radicle::node::Handle as _;
use radicle::node::policy::Scope;
use radicle::prelude::RepoId;
use radicle::test::fixtures;
use std::str::FromStr;

View File

@ -1,8 +1,8 @@
use crate::test;
use crate::util::environment::Environment;
use radicle::node;
use radicle::node::config::DefaultSeedingPolicy;
use radicle::node::Alias;
use radicle::node::config::DefaultSeedingPolicy;
#[test]
fn rad_seed_and_follow() {

View File

@ -1,8 +1,8 @@
use std::str::FromStr as _;
use radicle::node::Handle as _;
use radicle::node::config::DefaultSeedingPolicy;
use radicle::node::policy::Scope;
use radicle::node::Handle as _;
use radicle::prelude::RepoId;
use radicle::storage::{ReadStorage as _, RemoteRepository as _};

View File

@ -1,7 +1,7 @@
use std::str::FromStr as _;
use radicle::node::policy::Scope;
use radicle::node::DEFAULT_TIMEOUT;
use radicle::node::policy::Scope;
use radicle::node::{Alias, Handle as _};
use radicle::prelude::RepoId;
use radicle::profile;
@ -36,11 +36,13 @@ fn rad_config() {
let mut environment = Environment::new();
let alias = Alias::new("alice");
let profile = environment.profile_with(profile::Config {
preferred_seeds: vec![radicle::node::config::seeds::RADICLE_NODE_BOOTSTRAP_IRIS
.clone()
.first()
.unwrap()
.clone()],
preferred_seeds: vec![
radicle::node::config::seeds::RADICLE_NODE_BOOTSTRAP_IRIS
.clone()
.first()
.unwrap()
.clone(),
],
..profile::Config::new(alias)
});
let working = tempfile::tempdir().unwrap();

View File

@ -2,7 +2,7 @@ use std::path::PathBuf;
use std::str::FromStr;
use radicle::cob::cache::COBS_DB_FILE;
use radicle::crypto::ssh::{keystore::MemorySigner, Keystore};
use radicle::crypto::ssh::{Keystore, keystore::MemorySigner};
use radicle::crypto::{KeyPair, Seed};
use radicle::git;
use radicle::node::policy::store as policy;
@ -47,10 +47,9 @@ pub(crate) mod config {
},
..Limits::default()
},
external_addresses: vec![node::Address::from_str(&format!(
"{alias}.radicle.example:8776"
))
.unwrap()],
external_addresses: vec![
node::Address::from_str(&format!("{alias}.radicle.example:8776")).unwrap(),
],
..node(alias)
}
}

View File

@ -15,10 +15,10 @@ use crate::change::store::Version;
use crate::signatures;
use crate::trailers::CommitTrailer;
use crate::{
change,
change::{store, Contents, Entry, Timestamp},
Embed, change,
change::{Contents, Entry, Timestamp, store},
signatures::{ExtendedSignature, Signatures},
trailers, Embed,
trailers,
};
use super::commit::Commit;

View File

@ -6,9 +6,9 @@ use std::str::{self, FromStr};
use git2::{ObjectType, Oid};
use metadata::author::Author;
use metadata::commit::CommitData;
use metadata::commit::headers::Headers;
use metadata::commit::trailers::OwnedTrailer;
use metadata::commit::CommitData;
use trailers::Trailers;

View File

@ -7,7 +7,7 @@ use oid::Oid;
use serde::{Deserialize, Serialize};
use crate::object::collaboration::error::{Create, Update};
use crate::{signatures, TypeName};
use crate::{TypeName, signatures};
/// Change entry storage.
pub trait Storage {

View File

@ -7,8 +7,8 @@ use dag::Dag;
use oid::Oid;
use crate::{
change, object, object::collaboration::Evaluate, signatures::ExtendedSignature,
CollaborativeObject, Entry, EntryId, History, ObjectId, TypeName,
CollaborativeObject, Entry, EntryId, History, ObjectId, TypeName, change, object,
object::collaboration::Evaluate, signatures::ExtendedSignature,
};
#[derive(Debug, thiserror::Error)]

View File

@ -77,8 +77,8 @@ mod change_graph;
mod trailers;
pub mod change;
pub use change::store::{Contents, Embed, EntryId, Manifest, Version};
pub use change::Entry;
pub use change::store::{Contents, Embed, EntryId, Manifest, Version};
pub mod history;
pub use history::History;
@ -91,8 +91,8 @@ pub use type_name::TypeName;
pub mod object;
pub use object::{
create, get, info, list, remove, update, CollaborativeObject, Create, Evaluate, ObjectId,
Update, Updated,
CollaborativeObject, Create, Evaluate, ObjectId, Update, Updated, create, get, info, list,
remove, update,
};
#[cfg(test)]

View File

@ -9,8 +9,8 @@ use thiserror::Error;
pub mod collaboration;
pub use collaboration::{
create, get, info, list, parse_refstr, remove, update, CollaborativeObject, Create, Evaluate,
Update, Updated,
CollaborativeObject, Create, Evaluate, Update, Updated, create, get, info, list, parse_refstr,
remove, update,
};
pub mod storage;

View File

@ -6,12 +6,12 @@ use nonempty::NonEmpty;
use oid::Oid;
use crate::change::store::{Manifest, Version};
use crate::{change, Entry, History, ObjectId, TypeName};
use crate::{Entry, History, ObjectId, TypeName, change};
pub mod error;
mod create;
pub use create::{create, Create};
pub use create::{Create, create};
mod get;
pub use get::get;
@ -25,7 +25,7 @@ mod remove;
pub use remove::remove;
mod update;
pub use update::{update, Update, Updated};
pub use update::{Update, Updated, update};
/// A collaborative object
#[derive(Debug, Clone, PartialEq, Eq)]

View File

@ -2,7 +2,7 @@
use crypto::ssh::ExtendedSignature;
use crate::{change_graph::ChangeGraph, CollaborativeObject, Evaluate, ObjectId, TypeName};
use crate::{CollaborativeObject, Evaluate, ObjectId, TypeName, change_graph::ChangeGraph};
use super::error;
@ -24,10 +24,10 @@ where
T: Evaluate<S>,
S: crate::object::Storage,
S: crate::change::Storage<
ObjectId = crate::object::Oid,
Parent = crate::object::Oid,
Signatures = ExtendedSignature,
>,
ObjectId = crate::object::Oid,
Parent = crate::object::Oid,
Signatures = ExtendedSignature,
>,
{
let tip_refs = storage
.objects(typename, oid)

View File

@ -9,7 +9,7 @@ use std::collections::BTreeSet;
use crypto::ssh::ExtendedSignature;
use oid::Oid;
use crate::{change_graph::ChangeGraph, ObjectId, TypeName};
use crate::{ObjectId, TypeName, change_graph::ChangeGraph};
use super::error;
@ -41,10 +41,10 @@ pub fn changegraph<S>(
where
S: crate::object::Storage,
S: crate::change::Storage<
ObjectId = crate::object::Oid,
Parent = crate::object::Oid,
Signatures = ExtendedSignature,
>,
ObjectId = crate::object::Oid,
Parent = crate::object::Oid,
Signatures = ExtendedSignature,
>,
{
let tip_refs = storage
.objects(typename, oid)

View File

@ -1,6 +1,6 @@
// Copyright © 2022 The Radicle Link Contributors
use crate::{change_graph::ChangeGraph, CollaborativeObject, Evaluate, TypeName};
use crate::{CollaborativeObject, Evaluate, TypeName, change_graph::ChangeGraph};
use super::error;
@ -19,10 +19,10 @@ where
T: Evaluate<S>,
S: crate::object::Storage,
S: crate::change::Storage<
ObjectId = crate::object::Oid,
Parent = crate::object::Oid,
Signatures = crate::ExtendedSignature,
>,
ObjectId = crate::object::Oid,
Parent = crate::object::Oid,
Signatures = crate::ExtendedSignature,
>,
{
let references = storage
.types(typename)

View File

@ -5,8 +5,8 @@ use nonempty::NonEmpty;
use oid::Oid;
use crate::{
change, change_graph::ChangeGraph, history::EntryId, CollaborativeObject, Embed, Evaluate,
ExtendedSignature, ObjectId, TypeName,
CollaborativeObject, Embed, Evaluate, ExtendedSignature, ObjectId, TypeName, change,
change_graph::ChangeGraph, history::EntryId,
};
use super::error;

View File

@ -7,10 +7,10 @@ use std::{
ops::{Deref, DerefMut},
};
use crypto::{ssh, PublicKey};
use crypto::{PublicKey, ssh};
use metadata::commit::{
headers::Signature::{Pgp, Ssh},
CommitData,
headers::Signature::{Pgp, Ssh},
};
pub use ssh::ExtendedSignature;

View File

@ -6,9 +6,9 @@ use fmt::Component;
use tempfile::TempDir;
use crate::{
change,
ObjectId, Store, change,
object::{self, Reference},
signatures, ObjectId, Store,
signatures,
};
pub mod error {

View File

@ -2,7 +2,7 @@ use fmt::{Component, RefString};
use radicle_git_ref_format::refname;
use crate::{object, test::arbitrary::Invalid, ObjectId, TypeName};
use crate::{ObjectId, TypeName, object, test::arbitrary::Invalid};
#[cfg(feature = "git2")]
mod git {
@ -10,11 +10,11 @@ mod git {
use crypto::test::signer::MockSigner;
use crypto::{PublicKey, Signer};
use nonempty::{nonempty, NonEmpty};
use nonempty::{NonEmpty, nonempty};
use qcheck::Arbitrary;
use crate::{
create, get, list, update, Create, Entry, ObjectId, TypeName, Update, Updated, Version,
Create, Entry, ObjectId, TypeName, Update, Updated, Version, create, get, list, update,
};
use crate::test;

View File

@ -116,15 +116,19 @@ mod test {
assert!(TypeName::from_str("abc..ghi").is_err());
assert!(TypeName::from_str("abc.-123.ghi").is_err());
assert!(TypeName::from_str("abc.123-.ghi").is_err());
assert!(TypeName::from_str(&format!(
"a.very.long.name.that.exceeds.the.two-hundred-and-fifty-five.length.limit.{}",
"a".repeat(255)
))
.is_err());
assert!(TypeName::from_str(&format!(
"component.exceeds.sixty-three.limit.{}",
"a".repeat(64)
))
.is_err());
assert!(
TypeName::from_str(&format!(
"a.very.long.name.that.exceeds.the.two-hundred-and-fifty-five.length.limit.{}",
"a".repeat(255)
))
.is_err()
);
assert!(
TypeName::from_str(&format!(
"component.exceeds.sixty-three.limit.{}",
"a".repeat(64)
))
.is_err()
);
}
}

View File

@ -219,7 +219,7 @@ mod radicle_git_ref_format_impls {
mod serde_impls {
use alloc::string::String;
use serde::{de, Deserialize, Deserializer, Serialize};
use serde::{Deserialize, Deserializer, Serialize, de};
use super::RepoId;
@ -347,48 +347,72 @@ mod test {
fn invalid() {
assert!("".parse::<RepoId>().is_err());
assert!("not-a-valid-rid".parse::<RepoId>().is_err());
assert!("xyz:z3gqcJUoA1n9HaHKufZs5FCSGazv5"
.parse::<RepoId>()
.is_err());
assert!("RAD:z3gqcJUoA1n9HaHKufZs5FCSGazv5"
.parse::<RepoId>()
.is_err());
assert!(
"xyz:z3gqcJUoA1n9HaHKufZs5FCSGazv5"
.parse::<RepoId>()
.is_err()
);
assert!(
"RAD:z3gqcJUoA1n9HaHKufZs5FCSGazv5"
.parse::<RepoId>()
.is_err()
);
assert!("rad:".parse::<RepoId>().is_err());
assert!("rad:z3gqcJUoA1n9HaHKufZs5FCSG0zv5"
.parse::<RepoId>()
.is_err());
assert!("rad:z3gqcJUoA1n9HaHKufZs5FCSGOzv5"
.parse::<RepoId>()
.is_err());
assert!("rad:z3gqcJUoA1n9HaHKufZs5FCSGIzv5"
.parse::<RepoId>()
.is_err());
assert!("rad:z3gqcJUoA1n9HaHKufZs5FCSGlzv5"
.parse::<RepoId>()
.is_err());
assert!("rad:z3gqcJUoA1n9HaHKufZs5FCSGázv5"
.parse::<RepoId>()
.is_err());
assert!("rad:z3gqcJUoA1n9HaHKufZs5FCSG@zv5"
.parse::<RepoId>()
.is_err());
assert!("rad:Z3gqcJUoA1n9HaHKufZs5FCSGazv5"
.parse::<RepoId>()
.is_err());
assert!(
"rad:z3gqcJUoA1n9HaHKufZs5FCSG0zv5"
.parse::<RepoId>()
.is_err()
);
assert!(
"rad:z3gqcJUoA1n9HaHKufZs5FCSGOzv5"
.parse::<RepoId>()
.is_err()
);
assert!(
"rad:z3gqcJUoA1n9HaHKufZs5FCSGIzv5"
.parse::<RepoId>()
.is_err()
);
assert!(
"rad:z3gqcJUoA1n9HaHKufZs5FCSGlzv5"
.parse::<RepoId>()
.is_err()
);
assert!(
"rad:z3gqcJUoA1n9HaHKufZs5FCSGázv5"
.parse::<RepoId>()
.is_err()
);
assert!(
"rad:z3gqcJUoA1n9HaHKufZs5FCSG@zv5"
.parse::<RepoId>()
.is_err()
);
assert!(
"rad:Z3gqcJUoA1n9HaHKufZs5FCSGazv5"
.parse::<RepoId>()
.is_err()
);
assert!("rad:z3gqcJUoA1n9HaHKuf".parse::<RepoId>().is_err());
assert!("rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5abcdef"
.parse::<RepoId>()
.is_err());
assert!("rad: z3gqcJUoA1n9HaHKufZs5FCSGazv5"
.parse::<RepoId>()
.is_err());
assert!(
"rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5abcdef"
.parse::<RepoId>()
.is_err()
);
assert!(
"rad: z3gqcJUoA1n9HaHKufZs5FCSGazv5"
.parse::<RepoId>()
.is_err()
);
}
#[test]
fn valid() {
assert!("rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5"
.parse::<RepoId>()
.is_ok());
assert!(
"rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5"
.parse::<RepoId>()
.is_ok()
);
assert!("z3gqcJUoA1n9HaHKufZs5FCSGazv5".parse::<RepoId>().is_ok());
assert!("z3XncAdkZjeK9mQS5Sdc4qhw98BUX".parse::<RepoId>().is_ok());
}

View File

@ -6,7 +6,7 @@ use ec25519 as ed25519;
use serde::{Deserialize, Serialize};
use thiserror::Error;
pub use ed25519::{edwards25519, Error, KeyPair, Seed};
pub use ed25519::{Error, KeyPair, Seed, edwards25519};
pub extern crate signature;

View File

@ -1,6 +1,6 @@
use qcheck::Arbitrary;
use crate::{test::signer::MockSigner, KeyPair, PublicKey, SecretKey, Seed};
use crate::{KeyPair, PublicKey, SecretKey, Seed, test::signer::MockSigner};
impl Arbitrary for MockSigner {
fn arbitrary(g: &mut qcheck::Gen) -> Self {

View File

@ -1,4 +1,4 @@
use crate::{ssh::ExtendedSignature, KeyPair, PublicKey, SecretKey, Seed, Signature};
use crate::{KeyPair, PublicKey, SecretKey, Seed, Signature, ssh::ExtendedSignature};
#[derive(Debug, Clone)]
pub struct MockSigner {

View File

@ -1,7 +1,7 @@
use std::collections::HashMap;
use radicle::git::fmt::{Component, Qualified, RefString};
use radicle::git::Oid;
use radicle::git::fmt::{Component, Qualified, RefString};
use radicle::prelude::PublicKey;
use super::refs::{Applied, RefUpdate, Update};

View File

@ -18,8 +18,8 @@
use std::collections::BTreeMap;
use either::Either;
use radicle::git::fmt::{Namespaced, Qualified};
use radicle::git::Oid;
use radicle::git::fmt::{Namespaced, Qualified};
use radicle::prelude::PublicKey;
pub use radicle::storage::RefUpdate;

View File

@ -3,9 +3,8 @@ pub mod error;
use either::Either;
use radicle::git::raw::ErrorExt as _;
use radicle::git::{
self,
self, Oid,
fmt::{Namespaced, Qualified},
Oid,
};
use radicle::storage::git::Repository;

View File

@ -1,7 +1,6 @@
use radicle::git::{
self,
self, Oid,
fmt::{Namespaced, Qualified},
Oid,
};
use thiserror::Error;

View File

@ -1,12 +1,12 @@
use std::sync::atomic::{self, AtomicBool};
use std::sync::Arc;
use std::sync::atomic::{self, AtomicBool};
use bstr::BString;
use radicle::crypto::PublicKey;
use radicle::git::Oid;
use radicle::identity::{Doc, DocError};
use radicle::storage::git::Repository;
use radicle::storage::ReadRepository;
use radicle::storage::git::Repository;
use crate::policy::{Allowed, BlockList};
use crate::transport::{ConnectionStream, Transport};

View File

@ -12,9 +12,9 @@ mod state;
use std::io;
use std::time::Instant;
use gix_protocol::{handshake, Handshake};
use gix_protocol::{Handshake, handshake};
pub use gix_protocol::{transport::bstr::ByteSlice, RemoteProgress};
pub use gix_protocol::{RemoteProgress, transport::bstr::ByteSlice};
pub use handle::Handle;
pub use policy::{Allowed, BlockList, Scope};
use radicle::storage::git::Repository;
@ -22,8 +22,8 @@ pub use state::{Config, FetchLimit, FetchResult};
pub use transport::Transport;
use radicle::crypto::PublicKey;
use radicle::storage::refs::RefsAt;
use radicle::storage::ReadRepository as _;
use radicle::storage::refs::RefsAt;
use state::FetchState;
use thiserror::Error;

View File

@ -2,9 +2,8 @@ use bstr::{BString, ByteSlice};
use either::Either;
use radicle::crypto::PublicKey;
use radicle::git::{
self,
self, Oid,
fmt::{Component, Namespaced, Qualified},
Oid,
};
use thiserror::Error;

View File

@ -2,7 +2,7 @@ use std::collections::BTreeMap;
use std::ops::Not as _;
pub use radicle::storage::refs::SignedRefs;
pub use radicle::storage::{git::Validation, Validations};
pub use radicle::storage::{Validations, git::Validation};
use radicle::{crypto::PublicKey, storage::ValidateRepository};
pub mod error {

View File

@ -37,10 +37,10 @@ use either::Either;
use gix_protocol::handshake::Ref;
use nonempty::NonEmpty;
use radicle::crypto::PublicKey;
use radicle::git::fmt::{refname, Component, Namespaced, Qualified};
use radicle::git::fmt::{Component, Namespaced, Qualified, refname};
use radicle::storage::ReadRepository;
use radicle::storage::git::Repository;
use radicle::storage::refs::{RefsAt, Special};
use radicle::storage::ReadRepository;
use crate::git::refs::{Policy, Update, Updates};
use crate::policy::BlockList;

View File

@ -3,14 +3,14 @@ use std::time::Instant;
use gix_protocol::Handshake;
use radicle::crypto::PublicKey;
use radicle::git::{fmt::Qualified, Oid};
use radicle::git::{Oid, fmt::Qualified};
use radicle::identity::{Did, Doc, DocError};
use radicle::storage;
use radicle::storage::git::Repository;
use radicle::storage::refs::{FeatureLevel, RefsAt};
use radicle::storage::{
git::Validation, Remote, RemoteId, RemoteRepository, Remotes, ValidateRepository, Validations,
Remote, RemoteId, RemoteRepository, Remotes, ValidateRepository, Validations, git::Validation,
};
use crate::git;
@ -20,7 +20,7 @@ use crate::git::repository;
use crate::sigrefs::SignedRefs;
use crate::stage;
use crate::stage::ProtocolStage;
use crate::{refs, sigrefs, transport, Handle};
use crate::{Handle, refs, sigrefs, transport};
/// The data size limit, 5Mb, while fetching the special refs,
/// i.e. `rad/id` and `rad/sigrefs`.
@ -549,9 +549,13 @@ impl FetchState {
}) => {
let level_required = levels.max();
if level_reachable >= level_required {
log::info!("Non-delegate {remote} has downgraded history, currently stuck at '{actual}', expects to be upgraded to '{level_required}' and will be upgraded to '{level_reachable}'.")
log::info!(
"Non-delegate {remote} has downgraded history, currently stuck at '{actual}', expects to be upgraded to '{level_required}' and will be upgraded to '{level_reachable}'."
)
} else {
log::debug!("Non-delegate {remote} has downgraded history, currently stuck at '{actual}', expects to be upgraded to '{level_required}' but only level '{level_reachable}' was advertised.");
log::debug!(
"Non-delegate {remote} has downgraded history, currently stuck at '{actual}', expects to be upgraded to '{level_required}' but only level '{level_reachable}' was advertised."
);
self.prune(&remote);
continue;
}
@ -601,9 +605,13 @@ impl FetchState {
}) => {
let level_required = levels.max();
if level_reachable >= level_required {
log::info!("Delegate {remote} has downgraded history, currently stuck at '{actual}', expects to be upgraded to '{level_required}' and will be upgraded to '{level_reachable}'.")
log::info!(
"Delegate {remote} has downgraded history, currently stuck at '{actual}', expects to be upgraded to '{level_required}' and will be upgraded to '{level_reachable}'."
)
} else {
log::info!("Delegate {remote} has downgraded history, currently stuck at '{actual}', expects to be upgraded to '{level_required}' but only level '{level_reachable}' was advertised.");
log::info!(
"Delegate {remote} has downgraded history, currently stuck at '{actual}', expects to be upgraded to '{level_required}' but only level '{level_reachable}' was advertised."
);
self.prune(&remote);
continue;
}
@ -629,7 +637,10 @@ impl FetchState {
}
if level_reachable < FeatureLevel::LATEST {
log::warn!("Delegate {remote} is on feature level '{level_reachable}' which is lower than '{}', they should consider upgrading Radicle.", FeatureLevel::LATEST)
log::warn!(
"Delegate {remote} is on feature level '{level_reachable}' which is lower than '{}', they should consider upgrading Radicle.",
FeatureLevel::LATEST
)
}
}
}

View File

@ -4,18 +4,18 @@ pub(crate) mod ls_refs;
use std::collections::BTreeSet;
use std::io;
use std::path::PathBuf;
use std::sync::atomic::AtomicBool;
use std::sync::Arc;
use std::sync::atomic::AtomicBool;
use bstr::BString;
use gix_features::progress::prodash::progress;
use gix_protocol::handshake;
use gix_protocol::Handshake;
use gix_transport::client;
use gix_protocol::handshake;
use gix_transport::Protocol;
use gix_transport::Service;
use radicle::git::fmt::Qualified;
use gix_transport::client;
use radicle::git::Oid;
use radicle::git::fmt::Qualified;
use radicle::storage::git::Repository;
use thiserror::Error;

View File

@ -1,16 +1,16 @@
use std::io;
use std::path::PathBuf;
use std::sync::{atomic::AtomicBool, Arc};
use std::sync::{Arc, atomic::AtomicBool};
use gix_features::progress::{DynNestedProgress, NestedProgress};
use gix_pack as pack;
use gix_protocol::fetch::negotiate::one_round::State;
use gix_protocol::handshake::Ref;
use gix_protocol::{fetch, Handshake};
use gix_protocol::{Handshake, fetch};
use crate::git::packfile;
use super::{agent_name, Connection, WantsHaves};
use super::{Connection, WantsHaves, agent_name};
pub type Error = fetch::Error;

View File

@ -5,12 +5,12 @@ use std::io;
use gix_features::progress::Progress;
use gix_protocol::handshake::Ref;
use gix_protocol::transport::Protocol;
use gix_protocol::{ls_refs, Handshake};
use gix_protocol::{Handshake, ls_refs};
use gix_transport::bstr::BString;
use crate::stage::RefPrefix;
use super::{agent_name, Connection};
use super::{Connection, agent_name};
/// Configuration for running an ls-refs process.
///

View File

@ -6,9 +6,9 @@ use std::borrow::Cow;
use crate::author::Author;
use super::{
CommitData,
headers::Headers,
trailers::{OwnedTrailer, Token, Trailer},
CommitData,
};
#[derive(Debug, thiserror::Error)]

View File

@ -1,4 +1,4 @@
use crate::commit::parse::{parse, ParseError};
use crate::commit::parse::{ParseError, parse};
/// Helper type whose FromStr always fails.
///

View File

@ -142,9 +142,11 @@ This line is not a valid trailer."#;
assert_eq!(commit.trailers().count(), 0);
assert!(commit.message().contains("Signed-off-by"));
assert!(commit
.message()
.contains("This line is not a valid trailer."));
assert!(
commit
.message()
.contains("This line is not a valid trailer.")
);
}
#[test]

Some files were not shown because too many files have changed in this diff Show More