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:
parent
0494227e75
commit
8bac24d6ab
|
|
@ -1 +1 @@
|
||||||
edition = "2021"
|
edition = "2024"
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,13 @@ mod args;
|
||||||
|
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use anyhow::{anyhow, Context};
|
use anyhow::{Context, anyhow};
|
||||||
|
|
||||||
use radicle::crypto::ssh;
|
use radicle::crypto::ssh;
|
||||||
use radicle::crypto::ssh::Passphrase;
|
use radicle::crypto::ssh::Passphrase;
|
||||||
use radicle::node::Alias;
|
use radicle::node::Alias;
|
||||||
use radicle::profile::env;
|
use radicle::profile::env;
|
||||||
use radicle::{profile, Profile};
|
use radicle::{Profile, profile};
|
||||||
|
|
||||||
use crate::terminal as term;
|
use crate::terminal as term;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@ pub struct Args {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use clap::error::ErrorKind;
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
use clap::error::ErrorKind;
|
||||||
|
|
||||||
use super::Args;
|
use super::Args;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ mod args;
|
||||||
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use anyhow::anyhow;
|
|
||||||
use anyhow::Context as _;
|
use anyhow::Context as _;
|
||||||
|
use anyhow::anyhow;
|
||||||
|
|
||||||
use radicle::git;
|
use radicle::git;
|
||||||
use radicle::node::AliasStore;
|
use radicle::node::AliasStore;
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,15 @@ use std::path::PathBuf;
|
||||||
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
|
||||||
use radicle::identity::doc::RepoId;
|
|
||||||
use radicle::identity::IdError;
|
use radicle::identity::IdError;
|
||||||
|
use radicle::identity::doc::RepoId;
|
||||||
use radicle::node::policy::Scope;
|
use radicle::node::policy::Scope;
|
||||||
use radicle::prelude::*;
|
use radicle::prelude::*;
|
||||||
use radicle::storage::refs;
|
use radicle::storage::refs;
|
||||||
|
|
||||||
use crate::common_args::{
|
use crate::common_args::{
|
||||||
SignedReferencesFeatureLevel, SignedReferencesFeatureLevelParser,
|
ABOUT_FETCH_SIGNED_REFERENCES_FEATURE_LEVEL_MINIMUM, SignedReferencesFeatureLevel,
|
||||||
ABOUT_FETCH_SIGNED_REFERENCES_FEATURE_LEVEL_MINIMUM,
|
SignedReferencesFeatureLevelParser,
|
||||||
};
|
};
|
||||||
use crate::node::SyncSettings;
|
use crate::node::SyncSettings;
|
||||||
use crate::terminal;
|
use crate::terminal;
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ use crate::terminal as term;
|
||||||
|
|
||||||
pub use args::Args;
|
pub use args::Args;
|
||||||
|
|
||||||
use args::{parse_many_embeds, FilteredTypeName, Format};
|
use args::{FilteredTypeName, Format, parse_many_embeds};
|
||||||
|
|
||||||
fn embeds(
|
fn embeds(
|
||||||
repo: &storage::git::Repository,
|
repo: &storage::git::Repository,
|
||||||
|
|
|
||||||
|
|
@ -339,8 +339,8 @@ impl std::str::FromStr for FilteredTypeName {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use super::Args;
|
use super::Args;
|
||||||
use clap::error::ErrorKind;
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
use clap::error::ErrorKind;
|
||||||
|
|
||||||
const ARGS: &[&str] = &[
|
const ARGS: &[&str] = &[
|
||||||
"--repo",
|
"--repo",
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ use args::Command;
|
||||||
|
|
||||||
use std::path::Path;
|
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 as term;
|
||||||
use crate::terminal::Element as _;
|
use crate::terminal::Element as _;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
mod args;
|
mod args;
|
||||||
|
|
||||||
use radicle::node::{policy, Alias, AliasStore, Handle, NodeId};
|
use radicle::node::{Alias, AliasStore, Handle, NodeId, policy};
|
||||||
use radicle::{prelude::*, Node};
|
use radicle::{Node, prelude::*};
|
||||||
use radicle_term::{Element as _, Paint, Table};
|
use radicle_term::{Element as _, Paint, Table};
|
||||||
|
|
||||||
use crate::terminal as term;
|
use crate::terminal as term;
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,8 @@ pub struct Args {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use super::Args;
|
use super::Args;
|
||||||
use clap::error::ErrorKind;
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
use clap::error::ErrorKind;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn should_parse_rid_non_urn() {
|
fn should_parse_rid_non_urn() {
|
||||||
|
|
|
||||||
|
|
@ -2,21 +2,21 @@ mod args;
|
||||||
|
|
||||||
use std::collections::BTreeSet;
|
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::Title;
|
||||||
|
use radicle::cob::identity::{self, IdentityMut, Revision, RevisionId};
|
||||||
use radicle::identity::doc::update;
|
use radicle::identity::doc::update;
|
||||||
use radicle::identity::{doc, Doc, Identity, RawDoc};
|
use radicle::identity::{Doc, Identity, RawDoc, doc};
|
||||||
use radicle::node::device::Device;
|
|
||||||
use radicle::node::NodeId;
|
use radicle::node::NodeId;
|
||||||
|
use radicle::node::device::Device;
|
||||||
use radicle::storage::{ReadStorage as _, WriteRepository};
|
use radicle::storage::{ReadStorage as _, WriteRepository};
|
||||||
use radicle::{cob, crypto, Profile};
|
use radicle::{Profile, cob, crypto};
|
||||||
use radicle_surf::diff::Diff;
|
use radicle_surf::diff::Diff;
|
||||||
use radicle_term::Element;
|
use radicle_term::Element;
|
||||||
|
|
||||||
use crate::git::unified_diff::Encode as _;
|
|
||||||
use crate::git::Rev;
|
use crate::git::Rev;
|
||||||
|
use crate::git::unified_diff::Encode as _;
|
||||||
use crate::terminal as term;
|
use crate::terminal as term;
|
||||||
use crate::terminal::args::Error;
|
use crate::terminal::args::Error;
|
||||||
use crate::terminal::format::Author;
|
use crate::terminal::format::Author;
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@ use serde_json as json;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
use radicle::cob::{Title, TypeNameParse};
|
use radicle::cob::{Title, TypeNameParse};
|
||||||
|
use radicle::identity::doc::PayloadId;
|
||||||
use radicle::identity::doc::update::EditVisibility;
|
use radicle::identity::doc::update::EditVisibility;
|
||||||
use radicle::identity::doc::update::PayloadUpsert;
|
use radicle::identity::doc::update::PayloadUpsert;
|
||||||
use radicle::identity::doc::PayloadId;
|
|
||||||
use radicle::prelude::{Did, RepoId};
|
use radicle::prelude::{Did, RepoId};
|
||||||
|
|
||||||
use crate::git::Rev;
|
use crate::git::Rev;
|
||||||
|
|
@ -240,9 +240,9 @@ pub(super) enum Command {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use super::{parse_many_upserts, Args};
|
use super::{Args, parse_many_upserts};
|
||||||
use clap::error::ErrorKind;
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
use clap::error::ErrorKind;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn should_parse_single_payload() {
|
fn should_parse_single_payload() {
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ use anyhow::anyhow;
|
||||||
|
|
||||||
use localtime::LocalTime;
|
use localtime::LocalTime;
|
||||||
use radicle::cob::TypedId;
|
use radicle::cob::TypedId;
|
||||||
use radicle::git::fmt::Qualified;
|
|
||||||
use radicle::git::BranchName;
|
use radicle::git::BranchName;
|
||||||
|
use radicle::git::fmt::Qualified;
|
||||||
use radicle::identity::Identity;
|
use radicle::identity::Identity;
|
||||||
use radicle::issue::cache::Issues as _;
|
use radicle::issue::cache::Issues as _;
|
||||||
use radicle::node::notifications;
|
use radicle::node::notifications;
|
||||||
|
|
@ -18,7 +18,7 @@ use radicle::node::notifications::*;
|
||||||
use radicle::patch::cache::Patches as _;
|
use radicle::patch::cache::Patches as _;
|
||||||
use radicle::prelude::{NodeId, Profile, RepoId};
|
use radicle::prelude::{NodeId, Profile, RepoId};
|
||||||
use radicle::storage::{ReadRepository, ReadStorage};
|
use radicle::storage::{ReadRepository, ReadStorage};
|
||||||
use radicle::{cob, git, Storage};
|
use radicle::{Storage, cob, git};
|
||||||
|
|
||||||
use term::Element as _;
|
use term::Element as _;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ use std::convert::TryFrom;
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use anyhow::{anyhow, bail, Context as _};
|
use anyhow::{Context as _, anyhow, bail};
|
||||||
use serde_json as json;
|
use serde_json as json;
|
||||||
|
|
||||||
use radicle::crypto::ssh;
|
use radicle::crypto::ssh;
|
||||||
|
|
@ -21,9 +21,9 @@ use radicle::git::raw::ErrorExt as _;
|
||||||
use radicle::identity::project::ProjectName;
|
use radicle::identity::project::ProjectName;
|
||||||
use radicle::identity::{Doc, RepoId, Visibility};
|
use radicle::identity::{Doc, RepoId, Visibility};
|
||||||
use radicle::node::events::UploadPack;
|
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::storage::ReadStorage as _;
|
||||||
use radicle::{profile, Node};
|
use radicle::{Node, profile};
|
||||||
|
|
||||||
use crate::commands;
|
use crate::commands;
|
||||||
use crate::git;
|
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) {
|
let default_branch = match find_default_branch(&repo) {
|
||||||
Err(err @ DefaultBranchError::Head) => {
|
Err(err @ DefaultBranchError::Head) => {
|
||||||
term::error(err);
|
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`")
|
anyhow::bail!("aborting `rad init`")
|
||||||
}
|
}
|
||||||
Err(err @ DefaultBranchError::NoHead) => {
|
Err(err @ DefaultBranchError::NoHead) => {
|
||||||
|
|
@ -209,7 +211,9 @@ pub fn init(repo: git::Repository, args: Args, profile: &profile::Profile) -> an
|
||||||
term::warning(format!(
|
term::warning(format!(
|
||||||
"There was an error announcing your repository to the network: {e}"
|
"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::blank();
|
||||||
}
|
}
|
||||||
term::info!("To push changes, run {}.", term::format::command(push_cmd));
|
term::info!("To push changes, run {}.", term::format::command(push_cmd));
|
||||||
|
|
@ -445,7 +449,8 @@ pub fn announce(
|
||||||
term::blank();
|
term::blank();
|
||||||
term::info!(
|
term::info!(
|
||||||
"You are not connected to any peers. Your repository will be announced as soon as \
|
"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::info!("Check for peer connections with `rad node status`.");
|
||||||
term::blank();
|
term::blank();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ use std::path::PathBuf;
|
||||||
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use radicle::{
|
use radicle::{
|
||||||
identity::{project::ProjectName, Visibility},
|
identity::{Visibility, project::ProjectName},
|
||||||
node::policy::Scope,
|
node::policy::Scope,
|
||||||
prelude::RepoId,
|
prelude::RepoId,
|
||||||
};
|
};
|
||||||
|
|
@ -115,8 +115,8 @@ impl clap::builder::TypedValueParser for ScopeParser {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use super::Args;
|
use super::Args;
|
||||||
use clap::error::ErrorKind;
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
use clap::error::ErrorKind;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn should_parse_rid_non_urn() {
|
fn should_parse_rid_non_urn() {
|
||||||
|
|
|
||||||
|
|
@ -11,15 +11,15 @@ use chrono::prelude::*;
|
||||||
|
|
||||||
use radicle::identity::RepoId;
|
use radicle::identity::RepoId;
|
||||||
use radicle::identity::{DocAt, Identity};
|
use radicle::identity::{DocAt, Identity};
|
||||||
use radicle::node::policy::SeedingPolicy;
|
|
||||||
use radicle::node::AliasStore as _;
|
use radicle::node::AliasStore as _;
|
||||||
|
use radicle::node::policy::SeedingPolicy;
|
||||||
use radicle::storage::git::{Repository, Storage};
|
use radicle::storage::git::{Repository, Storage};
|
||||||
use radicle::storage::refs::{FeatureLevel, RefsAt, SignedRefs};
|
use radicle::storage::refs::{FeatureLevel, RefsAt, SignedRefs};
|
||||||
use radicle::storage::{ReadRepository, ReadStorage};
|
use radicle::storage::{ReadRepository, ReadStorage};
|
||||||
|
|
||||||
use crate::terminal as term;
|
use crate::terminal as term;
|
||||||
use crate::terminal::json;
|
|
||||||
use crate::terminal::Element;
|
use crate::terminal::Element;
|
||||||
|
use crate::terminal::json;
|
||||||
|
|
||||||
pub use args::Args;
|
pub use args::Args;
|
||||||
use args::Target;
|
use args::Target;
|
||||||
|
|
|
||||||
|
|
@ -6,18 +6,18 @@ use anyhow::Context as _;
|
||||||
|
|
||||||
use radicle::cob::common::Label;
|
use radicle::cob::common::Label;
|
||||||
use radicle::cob::issue::{CloseReason, State};
|
use radicle::cob::issue::{CloseReason, State};
|
||||||
use radicle::cob::{issue, Title};
|
use radicle::cob::{Title, issue};
|
||||||
|
|
||||||
|
use radicle::Profile;
|
||||||
use radicle::crypto;
|
use radicle::crypto;
|
||||||
use radicle::issue::cache::Issues as _;
|
use radicle::issue::cache::Issues as _;
|
||||||
use radicle::node::device::Device;
|
|
||||||
use radicle::node::NodeId;
|
use radicle::node::NodeId;
|
||||||
|
use radicle::node::device::Device;
|
||||||
use radicle::prelude::Did;
|
use radicle::prelude::Did;
|
||||||
use radicle::profile;
|
use radicle::profile;
|
||||||
use radicle::storage;
|
use radicle::storage;
|
||||||
use radicle::storage::{WriteRepository, WriteStorage};
|
use radicle::storage::{WriteRepository, WriteStorage};
|
||||||
use radicle::Profile;
|
use radicle::{Node, cob};
|
||||||
use radicle::{cob, Node};
|
|
||||||
|
|
||||||
pub use args::Args;
|
pub use args::Args;
|
||||||
use args::{Assigned, Command, CommentAction, StateArg};
|
use args::{Assigned, Command, CommentAction, StateArg};
|
||||||
|
|
@ -25,10 +25,10 @@ use args::{Assigned, Command, CommentAction, StateArg};
|
||||||
use crate::git::Rev;
|
use crate::git::Rev;
|
||||||
use crate::node;
|
use crate::node;
|
||||||
use crate::terminal as term;
|
use crate::terminal as term;
|
||||||
|
use crate::terminal::Element;
|
||||||
use crate::terminal::args::Error;
|
use crate::terminal::args::Error;
|
||||||
use crate::terminal::format::Author;
|
use crate::terminal::format::Author;
|
||||||
use crate::terminal::issue::Format;
|
use crate::terminal::issue::Format;
|
||||||
use crate::terminal::Element;
|
|
||||||
|
|
||||||
const ABOUT: &str = "Manage issues";
|
const ABOUT: &str = "Manage issues";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ use clap::{Parser, Subcommand};
|
||||||
|
|
||||||
use radicle::{
|
use radicle::{
|
||||||
cob::{Label, Reaction, Title},
|
cob::{Label, Reaction, Title},
|
||||||
identity::{did::DidError, Did, RepoId},
|
identity::{Did, RepoId, did::DidError},
|
||||||
issue::{CloseReason, State},
|
issue::{CloseReason, State},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
use std::ops::ControlFlow;
|
use std::ops::ControlFlow;
|
||||||
|
|
||||||
use radicle::issue::IssueId;
|
|
||||||
use radicle::storage::git::Repository;
|
|
||||||
use radicle::storage::ReadStorage as _;
|
|
||||||
use radicle::Profile;
|
use radicle::Profile;
|
||||||
|
use radicle::issue::IssueId;
|
||||||
|
use radicle::storage::ReadStorage as _;
|
||||||
|
use radicle::storage::git::Repository;
|
||||||
|
|
||||||
use crate::terminal as term;
|
use crate::terminal as term;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
|
use radicle::Profile;
|
||||||
use radicle::cob::thread;
|
use radicle::cob::thread;
|
||||||
use radicle::storage::WriteRepository;
|
use radicle::storage::WriteRepository;
|
||||||
use radicle::Profile;
|
|
||||||
use radicle::{cob, git, issue, storage};
|
use radicle::{cob, git, issue, storage};
|
||||||
|
|
||||||
use crate::git::Rev;
|
use crate::git::Rev;
|
||||||
use crate::terminal as term;
|
use crate::terminal as term;
|
||||||
use crate::terminal::patch::Message;
|
|
||||||
use crate::terminal::Element as _;
|
use crate::terminal::Element as _;
|
||||||
|
use crate::terminal::patch::Message;
|
||||||
|
|
||||||
pub(super) fn comment(
|
pub(super) fn comment(
|
||||||
profile: &Profile,
|
profile: &Profile,
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@ pub mod routing;
|
||||||
|
|
||||||
use std::{process, time};
|
use std::{process, time};
|
||||||
|
|
||||||
|
use radicle::node::Handle as _;
|
||||||
|
use radicle::node::Node;
|
||||||
use radicle::node::address::Store as AddressStore;
|
use radicle::node::address::Store as AddressStore;
|
||||||
use radicle::node::config::ConnectAddress;
|
use radicle::node::config::ConnectAddress;
|
||||||
use radicle::node::routing::Store;
|
use radicle::node::routing::Store;
|
||||||
use radicle::node::Handle as _;
|
|
||||||
use radicle::node::Node;
|
|
||||||
|
|
||||||
use crate::commands::node::args::Only;
|
use crate::commands::node::args::Only;
|
||||||
use crate::terminal as term;
|
use crate::terminal as term;
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,14 @@ use std::fs::File;
|
||||||
use std::io::{BufRead, BufReader, Read, Seek, SeekFrom, Write};
|
use std::io::{BufRead, BufReader, Read, Seek, SeekFrom, Write};
|
||||||
use std::{path::Path, process, thread, time};
|
use std::{path::Path, process, thread, time};
|
||||||
|
|
||||||
use anyhow::{anyhow, Context};
|
use anyhow::{Context, anyhow};
|
||||||
use localtime::LocalTime;
|
use localtime::LocalTime;
|
||||||
|
|
||||||
|
use radicle::Node;
|
||||||
use radicle::node;
|
use radicle::node;
|
||||||
use radicle::node::{Address, ConnectResult, Handle as _, NodeId};
|
use radicle::node::{Address, ConnectResult, Handle as _, NodeId};
|
||||||
use radicle::profile::env::RAD_PASSPHRASE;
|
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::commands::node::logs::{LogRotatorFileSystem, Rotated};
|
||||||
use crate::terminal as term;
|
use crate::terminal as term;
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,10 @@ use std::collections::BTreeSet;
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
|
|
||||||
use radicle::cob::patch::PatchId;
|
use radicle::cob::patch::PatchId;
|
||||||
use radicle::cob::{patch, Label};
|
use radicle::cob::{Label, patch};
|
||||||
use radicle::patch::cache::Patches as _;
|
use radicle::patch::cache::Patches as _;
|
||||||
use radicle::storage::git::transport;
|
use radicle::storage::git::transport;
|
||||||
use radicle::{prelude::*, Node};
|
use radicle::{Node, prelude::*};
|
||||||
|
|
||||||
use crate::git::Rev;
|
use crate::git::Rev;
|
||||||
use crate::node;
|
use crate::node;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
use std::ops::ControlFlow;
|
use std::ops::ControlFlow;
|
||||||
|
|
||||||
use radicle::patch::PatchId;
|
|
||||||
use radicle::storage::git::Repository;
|
|
||||||
use radicle::storage::ReadStorage as _;
|
|
||||||
use radicle::Profile;
|
use radicle::Profile;
|
||||||
|
use radicle::patch::PatchId;
|
||||||
|
use radicle::storage::ReadStorage as _;
|
||||||
|
use radicle::storage::git::Repository;
|
||||||
|
|
||||||
use crate::terminal as term;
|
use crate::terminal as term;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,10 @@ use radicle::cob::patch::RevisionId;
|
||||||
use radicle::git::fmt::Qualified;
|
use radicle::git::fmt::Qualified;
|
||||||
use radicle::git::fmt::RefString;
|
use radicle::git::fmt::RefString;
|
||||||
use radicle::git::raw::ErrorExt as _;
|
use radicle::git::raw::ErrorExt as _;
|
||||||
use radicle::patch::cache::Patches as _;
|
|
||||||
use radicle::patch::PatchId;
|
use radicle::patch::PatchId;
|
||||||
|
use radicle::patch::cache::Patches as _;
|
||||||
use radicle::storage::git::Repository;
|
use radicle::storage::git::Repository;
|
||||||
use radicle::{git, rad, Profile};
|
use radicle::{Profile, git, rad};
|
||||||
|
|
||||||
use crate::terminal as term;
|
use crate::terminal as term;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
|
|
||||||
|
use radicle::Profile;
|
||||||
use radicle::cob;
|
use radicle::cob;
|
||||||
use radicle::cob::patch;
|
use radicle::cob::patch;
|
||||||
use radicle::cob::thread;
|
use radicle::cob::thread;
|
||||||
use radicle::patch::cache::Patches as _;
|
|
||||||
use radicle::patch::ByRevision;
|
use radicle::patch::ByRevision;
|
||||||
|
use radicle::patch::cache::Patches as _;
|
||||||
use radicle::storage::git::Repository;
|
use radicle::storage::git::Repository;
|
||||||
use radicle::Profile;
|
|
||||||
|
|
||||||
use crate::git;
|
use crate::git;
|
||||||
use crate::terminal as term;
|
use crate::terminal as term;
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
|
|
||||||
|
use radicle::Profile;
|
||||||
use radicle::cob;
|
use radicle::cob;
|
||||||
|
use radicle::cob::Reaction;
|
||||||
use radicle::cob::patch;
|
use radicle::cob::patch;
|
||||||
use radicle::cob::thread;
|
use radicle::cob::thread;
|
||||||
use radicle::cob::Reaction;
|
|
||||||
use radicle::patch::cache::Patches as _;
|
|
||||||
use radicle::patch::ByRevision;
|
use radicle::patch::ByRevision;
|
||||||
|
use radicle::patch::cache::Patches as _;
|
||||||
use radicle::storage::git::Repository;
|
use radicle::storage::git::Repository;
|
||||||
use radicle::Profile;
|
|
||||||
|
|
||||||
use crate::git;
|
use crate::git;
|
||||||
use crate::terminal as term;
|
use crate::terminal as term;
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
|
|
||||||
|
use radicle::Profile;
|
||||||
use radicle::cob;
|
use radicle::cob;
|
||||||
use radicle::cob::patch;
|
use radicle::cob::patch;
|
||||||
use radicle::cob::thread;
|
use radicle::cob::thread;
|
||||||
use radicle::patch::cache::Patches as _;
|
|
||||||
use radicle::patch::ByRevision;
|
use radicle::patch::ByRevision;
|
||||||
|
use radicle::patch::cache::Patches as _;
|
||||||
use radicle::storage::git::Repository;
|
use radicle::storage::git::Repository;
|
||||||
use radicle::Profile;
|
|
||||||
|
|
||||||
use crate::git;
|
use crate::git;
|
||||||
use crate::terminal as term;
|
use crate::terminal as term;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
use radicle::cob;
|
use radicle::cob;
|
||||||
use radicle::cob::patch;
|
|
||||||
use radicle::cob::Title;
|
use radicle::cob::Title;
|
||||||
|
use radicle::cob::patch;
|
||||||
use radicle::crypto;
|
use radicle::crypto;
|
||||||
use radicle::node::device::Device;
|
use radicle::node::device::Device;
|
||||||
use radicle::prelude::*;
|
use radicle::prelude::*;
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@ use radicle::prelude::*;
|
||||||
use radicle::profile::Profile;
|
use radicle::profile::Profile;
|
||||||
use radicle::storage::git::Repository;
|
use radicle::storage::git::Repository;
|
||||||
|
|
||||||
|
use term::Element as _;
|
||||||
use term::format::Author;
|
use term::format::Author;
|
||||||
use term::table::{Table, TableOptions};
|
use term::table::{Table, TableOptions};
|
||||||
use term::Element as _;
|
|
||||||
|
|
||||||
use crate::terminal as term;
|
use crate::terminal as term;
|
||||||
use crate::terminal::patch as common;
|
use crate::terminal::patch as common;
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
use anyhow::anyhow;
|
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::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::git;
|
||||||
use crate::terminal as term;
|
use crate::terminal as term;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
|
use radicle::Profile;
|
||||||
use radicle::cob::thread::CommentId;
|
use radicle::cob::thread::CommentId;
|
||||||
use radicle::patch::{self, PatchId};
|
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::storage::git::Repository;
|
||||||
use radicle::Profile;
|
|
||||||
|
|
||||||
use crate::terminal as term;
|
use crate::terminal as term;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
mod builder;
|
mod builder;
|
||||||
|
|
||||||
use anyhow::{anyhow, Context};
|
use anyhow::{Context, anyhow};
|
||||||
|
|
||||||
use radicle::cob::patch::{PatchId, RevisionId, Verdict};
|
use radicle::cob::patch::{PatchId, RevisionId, Verdict};
|
||||||
use radicle::git;
|
use radicle::git;
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ use radicle::git;
|
||||||
use radicle::git::Oid;
|
use radicle::git::Oid;
|
||||||
use radicle::node::device::Device;
|
use radicle::node::device::Device;
|
||||||
use radicle::prelude::*;
|
use radicle::prelude::*;
|
||||||
use radicle::storage::git::{cob::DraftStore, Repository};
|
use radicle::storage::git::{Repository, cob::DraftStore};
|
||||||
use radicle_surf::diff::*;
|
use radicle_surf::diff::*;
|
||||||
use radicle_term::{Element, VStack};
|
use radicle_term::{Element, VStack};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
mod args;
|
mod args;
|
||||||
|
|
||||||
use anyhow::{anyhow, Context as _};
|
use anyhow::{Context as _, anyhow};
|
||||||
|
|
||||||
use radicle::cob;
|
use radicle::cob;
|
||||||
use radicle::identity::{Identity, Visibility};
|
use radicle::identity::{Identity, Visibility};
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@ pub struct Args {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use super::Args;
|
use super::Args;
|
||||||
use clap::error::ErrorKind;
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
use clap::error::ErrorKind;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn should_parse_rid_non_urn() {
|
fn should_parse_rid_non_urn() {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
|
use radicle::Profile;
|
||||||
use radicle::git;
|
use radicle::git;
|
||||||
use radicle::git::fmt::RefString;
|
use radicle::git::fmt::RefString;
|
||||||
use radicle::prelude::*;
|
use radicle::prelude::*;
|
||||||
use radicle::Profile;
|
|
||||||
use radicle_crypto::PublicKey;
|
use radicle_crypto::PublicKey;
|
||||||
|
|
||||||
use crate::commands::checkout;
|
use crate::commands::checkout;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
|
||||||
|
use radicle::Profile;
|
||||||
use radicle::git::Url;
|
use radicle::git::Url;
|
||||||
use radicle::identity::{Did, RepoId};
|
use radicle::identity::{Did, RepoId};
|
||||||
use radicle::node::{Alias, AliasStore as _, NodeId};
|
use radicle::node::{Alias, AliasStore as _, NodeId};
|
||||||
use radicle::storage::ReadStorage as _;
|
use radicle::storage::ReadStorage as _;
|
||||||
use radicle::Profile;
|
|
||||||
use radicle_term::{Element, Table};
|
use radicle_term::{Element, Table};
|
||||||
|
|
||||||
use crate::git;
|
use crate::git;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
mod args;
|
mod args;
|
||||||
|
|
||||||
|
use radicle::node::Handle;
|
||||||
use radicle::node::policy;
|
use radicle::node::policy;
|
||||||
use radicle::node::policy::{Policy, Scope};
|
use radicle::node::policy::{Policy, Scope};
|
||||||
use radicle::node::Handle;
|
use radicle::{Node, prelude::*};
|
||||||
use radicle::{prelude::*, Node};
|
|
||||||
use radicle_term::Element as _;
|
use radicle_term::Element as _;
|
||||||
|
|
||||||
use crate::commands::sync;
|
use crate::commands::sync;
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,13 @@ use std::collections::BTreeMap;
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use std::time;
|
use std::time;
|
||||||
|
|
||||||
use anyhow::{anyhow, Context as _};
|
use anyhow::{Context as _, anyhow};
|
||||||
|
|
||||||
use radicle::node;
|
use radicle::node;
|
||||||
|
use radicle::node::SyncedAt;
|
||||||
use radicle::node::address::Store;
|
use radicle::node::address::Store;
|
||||||
use radicle::node::sync;
|
use radicle::node::sync;
|
||||||
use radicle::node::sync::fetch::SuccessfulOutcome;
|
use radicle::node::sync::fetch::SuccessfulOutcome;
|
||||||
use radicle::node::SyncedAt;
|
|
||||||
use radicle::node::{AliasStore, Handle as _, Node, Seed, SyncStatus};
|
use radicle::node::{AliasStore, Handle as _, Node, Seed, SyncStatus};
|
||||||
use radicle::prelude::{NodeId, Profile, RepoId};
|
use radicle::prelude::{NodeId, Profile, RepoId};
|
||||||
use radicle::storage::ReadRepository;
|
use radicle::storage::ReadRepository;
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,14 @@ use std::time;
|
||||||
use clap::{Parser, Subcommand, ValueEnum};
|
use clap::{Parser, Subcommand, ValueEnum};
|
||||||
|
|
||||||
use radicle::{
|
use radicle::{
|
||||||
node::{sync, NodeId},
|
node::{NodeId, sync},
|
||||||
prelude::RepoId,
|
prelude::RepoId,
|
||||||
storage::refs,
|
storage::refs,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::common_args::{
|
use crate::common_args::{
|
||||||
SignedReferencesFeatureLevel, SignedReferencesFeatureLevelParser,
|
ABOUT_FETCH_SIGNED_REFERENCES_FEATURE_LEVEL_MINIMUM, SignedReferencesFeatureLevel,
|
||||||
ABOUT_FETCH_SIGNED_REFERENCES_FEATURE_LEVEL_MINIMUM,
|
SignedReferencesFeatureLevelParser,
|
||||||
};
|
};
|
||||||
use crate::node::SyncSettings;
|
use crate::node::SyncSettings;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
pub mod args;
|
pub mod args;
|
||||||
|
|
||||||
use radicle::{prelude::*, Node};
|
use radicle::{Node, prelude::*};
|
||||||
|
|
||||||
use crate::terminal as term;
|
use crate::terminal as term;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ mod args;
|
||||||
|
|
||||||
use std::{thread, time};
|
use std::{thread, time};
|
||||||
|
|
||||||
use anyhow::{anyhow, Context as _};
|
use anyhow::{Context as _, anyhow};
|
||||||
|
|
||||||
use radicle::git;
|
use radicle::git;
|
||||||
use radicle::git::raw::ErrorExt as _;
|
use radicle::git::raw::ErrorExt as _;
|
||||||
|
|
|
||||||
|
|
@ -14,21 +14,21 @@ use std::path::{Path, PathBuf};
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use anyhow::anyhow;
|
|
||||||
use anyhow::Context as _;
|
use anyhow::Context as _;
|
||||||
|
use anyhow::anyhow;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
use radicle::crypto::ssh;
|
use radicle::crypto::ssh;
|
||||||
use radicle::git;
|
use radicle::git;
|
||||||
use radicle::git::{Version, VERSION_REQUIRED};
|
use radicle::git::{VERSION_REQUIRED, Version};
|
||||||
use radicle::prelude::{NodeId, RepoId};
|
use radicle::prelude::{NodeId, RepoId};
|
||||||
use radicle::storage::git::transport;
|
use radicle::storage::git::transport;
|
||||||
|
|
||||||
pub use radicle::git::Oid;
|
pub use radicle::git::Oid;
|
||||||
|
|
||||||
pub use radicle::git::raw::{
|
pub use radicle::git::raw::{
|
||||||
build::CheckoutBuilder, AnnotatedCommit, Commit, Direction, ErrorCode, ErrorExt as _,
|
AnnotatedCommit, Commit, Direction, ErrorCode, ErrorExt as _, MergeAnalysis, MergeOptions,
|
||||||
MergeAnalysis, MergeOptions, Reference, Repository, Signature,
|
Reference, Repository, Signature, build::CheckoutBuilder,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const CONFIG_COMMIT_GPG_SIGN: &str = "commit.gpgsign";
|
pub const CONFIG_COMMIT_GPG_SIGN: &str = "commit.gpgsign";
|
||||||
|
|
|
||||||
|
|
@ -305,7 +305,7 @@ impl unified_diff::Decode for DiffModification {
|
||||||
(v1, v2) => {
|
(v1, v2) => {
|
||||||
return Err(unified_diff::Error::syntax(format!(
|
return Err(unified_diff::Error::syntax(format!(
|
||||||
"indicator character expected, but got '{v1}{v2}'"
|
"indicator character expected, but got '{v1}{v2}'"
|
||||||
)))
|
)));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ use radicle_surf::diff;
|
||||||
use radicle_surf::diff::{Added, Copied, Deleted, FileStats, Hunks, Modified, Moved};
|
use radicle_surf::diff::{Added, Copied, Deleted, FileStats, Hunks, Modified, Moved};
|
||||||
use radicle_surf::diff::{Diff, DiffContent, FileDiff, Hunk, Modification};
|
use radicle_surf::diff::{Diff, DiffContent, FileDiff, Hunk, Modification};
|
||||||
use radicle_term as term;
|
use radicle_term as term;
|
||||||
use term::cell::Cell;
|
|
||||||
use term::VStack;
|
use term::VStack;
|
||||||
|
use term::cell::Cell;
|
||||||
|
|
||||||
use crate::git::unified_diff::FileHeader;
|
use crate::git::unified_diff::FileHeader;
|
||||||
use crate::terminal::highlight::{Highlighter, Theme};
|
use crate::terminal::highlight::{Highlighter, Theme};
|
||||||
|
|
|
||||||
|
|
@ -533,7 +533,7 @@ impl Decode for Modification {
|
||||||
Some(c) => {
|
Some(c) => {
|
||||||
return Err(Error::syntax(format!(
|
return Err(Error::syntax(format!(
|
||||||
"indicator character expected, but got '{c}'",
|
"indicator character expected, but got '{c}'",
|
||||||
)))
|
)));
|
||||||
}
|
}
|
||||||
None => return Err(Error::UnexpectedEof),
|
None => return Err(Error::UnexpectedEof),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ use std::io::Write;
|
||||||
use std::{io::ErrorKind, process};
|
use std::{io::ErrorKind, process};
|
||||||
|
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use clap::builder::styling::AnsiColor;
|
|
||||||
use clap::builder::Styles;
|
use clap::builder::Styles;
|
||||||
|
use clap::builder::styling::AnsiColor;
|
||||||
use clap::{CommandFactory as _, Parser, Subcommand};
|
use clap::{CommandFactory as _, Parser, Subcommand};
|
||||||
|
|
||||||
use radicle::version::Version;
|
use radicle::version::Version;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ use std::io::Write;
|
||||||
|
|
||||||
use radicle::node::sync;
|
use radicle::node::sync;
|
||||||
use radicle::node::{Handle as _, NodeId};
|
use radicle::node::{Handle as _, NodeId};
|
||||||
use radicle::storage::{refs, ReadRepository, RepositoryError};
|
use radicle::storage::{ReadRepository, RepositoryError, refs};
|
||||||
use radicle::{Node, Profile};
|
use radicle::{Node, Profile};
|
||||||
|
|
||||||
use crate::terminal as term;
|
use crate::terminal as term;
|
||||||
|
|
@ -136,7 +136,9 @@ pub fn announce<R: ReadRepository>(
|
||||||
match announce_(repo, settings, reporting, node, profile) {
|
match announce_(repo, settings, reporting, node, profile) {
|
||||||
Ok(result) => Ok(result),
|
Ok(result) => Ok(result),
|
||||||
Err(e) if e.is_connection_err() => {
|
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)
|
Ok(None)
|
||||||
}
|
}
|
||||||
Err(e) => Err(e),
|
Err(e) => Err(e),
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,9 @@ pub(crate) enum BlockTarget {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Error)]
|
#[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 {
|
pub(crate) struct BlockTargetParseError {
|
||||||
repo: radicle::identity::IdError,
|
repo: radicle::identity::IdError,
|
||||||
node: radicle::crypto::PublicKeyError,
|
node: radicle::crypto::PublicKeyError,
|
||||||
|
|
@ -62,7 +64,9 @@ impl std::fmt::Display for BlockTarget {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[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 {
|
pub(crate) struct NodeIdParseError {
|
||||||
did: radicle::identity::did::DidError,
|
did: radicle::identity::did::DidError,
|
||||||
nid: radicle::crypto::PublicKeyError,
|
nid: radicle::crypto::PublicKeyError,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
use radicle::{
|
use radicle::{
|
||||||
|
Profile,
|
||||||
cob::{
|
cob::{
|
||||||
self,
|
self,
|
||||||
cache::{MigrateCallback, MigrateProgress},
|
cache::{MigrateCallback, MigrateProgress},
|
||||||
|
|
@ -6,7 +7,6 @@ use radicle::{
|
||||||
prelude::NodeId,
|
prelude::NodeId,
|
||||||
profile,
|
profile,
|
||||||
storage::ReadRepository,
|
storage::ReadRepository,
|
||||||
Profile,
|
|
||||||
};
|
};
|
||||||
use radicle_term as term;
|
use radicle_term as term;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
use radicle::cob::thread::{Comment, CommentId};
|
|
||||||
use radicle::Profile;
|
use radicle::Profile;
|
||||||
|
use radicle::cob::thread::{Comment, CommentId};
|
||||||
|
|
||||||
use crate::terminal as term;
|
use crate::terminal as term;
|
||||||
use crate::terminal::format::Author;
|
use crate::terminal::format::Author;
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,14 @@ use std::fmt;
|
||||||
use localtime::LocalTime;
|
use localtime::LocalTime;
|
||||||
|
|
||||||
pub use radicle_term::format::*;
|
pub use radicle_term::format::*;
|
||||||
pub use radicle_term::{style, Paint};
|
pub use radicle_term::{Paint, style};
|
||||||
|
|
||||||
use radicle::cob::ObjectId;
|
use radicle::cob::ObjectId;
|
||||||
use radicle::identity::Visibility;
|
use radicle::identity::Visibility;
|
||||||
use radicle::node::policy::Policy;
|
use radicle::node::policy::Policy;
|
||||||
use radicle::node::{Alias, AliasStore, NodeId};
|
use radicle::node::{Alias, AliasStore, NodeId};
|
||||||
use radicle::prelude::Did;
|
use radicle::prelude::Did;
|
||||||
use radicle::profile::{env, Profile};
|
use radicle::profile::{Profile, env};
|
||||||
use radicle::storage::RefUpdate;
|
use radicle::storage::RefUpdate;
|
||||||
use radicle_term::element::Line;
|
use radicle_term::element::Line;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
|
use radicle::cob::Reaction;
|
||||||
use radicle::cob::issue::Issue;
|
use radicle::cob::issue::Issue;
|
||||||
use radicle::cob::thread::{Comment, CommentId};
|
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;
|
||||||
|
use radicle::crypto::ssh::keystore::MemorySigner;
|
||||||
use radicle::node::device::{BoxedDevice, Device};
|
use radicle::node::device::{BoxedDevice, Device};
|
||||||
use radicle::profile::env::RAD_PASSPHRASE;
|
|
||||||
use radicle::profile::Profile;
|
use radicle::profile::Profile;
|
||||||
|
use radicle::profile::env::RAD_PASSPHRASE;
|
||||||
|
|
||||||
pub use radicle_term::io::*;
|
pub use radicle_term::io::*;
|
||||||
pub use radicle_term::spinner;
|
pub use radicle_term::spinner;
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,14 @@ use std::io;
|
||||||
use radicle_term::table::TableOptions;
|
use radicle_term::table::TableOptions;
|
||||||
use radicle_term::{Table, VStack};
|
use radicle_term::{Table, VStack};
|
||||||
|
|
||||||
|
use radicle::Profile;
|
||||||
use radicle::cob;
|
use radicle::cob;
|
||||||
use radicle::cob::issue;
|
use radicle::cob::issue;
|
||||||
use radicle::cob::issue::CloseReason;
|
use radicle::cob::issue::CloseReason;
|
||||||
use radicle::Profile;
|
|
||||||
|
|
||||||
use crate::terminal as term;
|
use crate::terminal as term;
|
||||||
use crate::terminal::format::Author;
|
|
||||||
use crate::terminal::Element;
|
use crate::terminal::Element;
|
||||||
|
use crate::terminal::format::Author;
|
||||||
|
|
||||||
pub const OPEN_MSG: &str = r#"
|
pub const OPEN_MSG: &str = r#"
|
||||||
<!--
|
<!--
|
||||||
|
|
|
||||||
|
|
@ -9,13 +9,13 @@ use std::io::IsTerminal as _;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
use radicle::cob;
|
use radicle::cob;
|
||||||
use radicle::cob::patch;
|
|
||||||
use radicle::cob::Title;
|
use radicle::cob::Title;
|
||||||
|
use radicle::cob::patch;
|
||||||
use radicle::git;
|
use radicle::git;
|
||||||
use radicle::patch::{Patch, PatchId};
|
use radicle::patch::{Patch, PatchId};
|
||||||
use radicle::prelude::Profile;
|
use radicle::prelude::Profile;
|
||||||
use radicle::storage::git::Repository;
|
|
||||||
use radicle::storage::WriteRepository as _;
|
use radicle::storage::WriteRepository as _;
|
||||||
|
use radicle::storage::git::Repository;
|
||||||
|
|
||||||
use crate::terminal as term;
|
use crate::terminal as term;
|
||||||
use crate::terminal::Element;
|
use crate::terminal::Element;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::sync::LazyLock;
|
use std::sync::LazyLock;
|
||||||
|
|
||||||
use radicle::node::config::ConnectAddress;
|
|
||||||
use radicle::node::Address;
|
use radicle::node::Address;
|
||||||
|
use radicle::node::config::ConnectAddress;
|
||||||
use radicle::profile::Config;
|
use radicle::profile::Config;
|
||||||
|
|
||||||
static NODES_RENAMED: LazyLock<HashMap<Address, Address>> = LazyLock::new(|| {
|
static NODES_RENAMED: LazyLock<HashMap<Address, Address>> = LazyLock::new(|| {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
use crate::test;
|
use crate::test;
|
||||||
use crate::util::environment::Environment;
|
use crate::util::environment::Environment;
|
||||||
use radicle::node;
|
use radicle::node;
|
||||||
|
use radicle::node::UserAgent;
|
||||||
use radicle::node::address::Store as _;
|
use radicle::node::address::Store as _;
|
||||||
use radicle::node::policy::Scope;
|
use radicle::node::policy::Scope;
|
||||||
use radicle::node::routing::Store as _;
|
use radicle::node::routing::Store as _;
|
||||||
use radicle::node::UserAgent;
|
|
||||||
use radicle::node::{Alias, Handle as _};
|
use radicle::node::{Alias, Handle as _};
|
||||||
use radicle::prelude::{NodeId, RepoId};
|
use radicle::prelude::{NodeId, RepoId};
|
||||||
use radicle::storage::ReadStorage as _;
|
use radicle::storage::ReadStorage as _;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
use crate::test;
|
use crate::test;
|
||||||
use crate::util::environment::Environment;
|
use crate::util::environment::Environment;
|
||||||
use crate::util::formula::formula;
|
use crate::util::formula::formula;
|
||||||
use radicle::node::policy::Scope;
|
|
||||||
use radicle::node::Event;
|
|
||||||
use radicle::node::DEFAULT_TIMEOUT;
|
use radicle::node::DEFAULT_TIMEOUT;
|
||||||
|
use radicle::node::Event;
|
||||||
|
use radicle::node::policy::Scope;
|
||||||
use radicle::node::{Alias, Handle as _};
|
use radicle::node::{Alias, Handle as _};
|
||||||
use radicle::prelude::RepoId;
|
use radicle::prelude::RepoId;
|
||||||
use radicle::storage::ReadStorage as _;
|
use radicle::storage::ReadStorage as _;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
use crate::test;
|
use crate::test;
|
||||||
use crate::util::environment::Environment;
|
use crate::util::environment::Environment;
|
||||||
use radicle::node::address::Store as _;
|
|
||||||
use radicle::node::config::DefaultSeedingPolicy;
|
|
||||||
use radicle::node::Address;
|
use radicle::node::Address;
|
||||||
use radicle::node::UserAgent;
|
use radicle::node::UserAgent;
|
||||||
|
use radicle::node::address::Store as _;
|
||||||
|
use radicle::node::config::DefaultSeedingPolicy;
|
||||||
use radicle::node::{Alias, Handle as _};
|
use radicle::node::{Alias, Handle as _};
|
||||||
use radicle::test::fixtures;
|
use radicle::test::fixtures;
|
||||||
use radicle_localtime::LocalTime;
|
use radicle_localtime::LocalTime;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
use crate::test;
|
use crate::test;
|
||||||
use crate::util::environment::Environment;
|
use crate::util::environment::Environment;
|
||||||
use crate::util::formula::formula;
|
use crate::util::formula::formula;
|
||||||
use radicle::node::policy::Scope;
|
|
||||||
use radicle::node::Handle as _;
|
use radicle::node::Handle as _;
|
||||||
|
use radicle::node::policy::Scope;
|
||||||
use radicle::prelude::RepoId;
|
use radicle::prelude::RepoId;
|
||||||
use radicle::test::fixtures;
|
use radicle::test::fixtures;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
use crate::test;
|
use crate::test;
|
||||||
use crate::util::environment::Environment;
|
use crate::util::environment::Environment;
|
||||||
use radicle::node;
|
use radicle::node;
|
||||||
use radicle::node::config::DefaultSeedingPolicy;
|
|
||||||
use radicle::node::Alias;
|
use radicle::node::Alias;
|
||||||
|
use radicle::node::config::DefaultSeedingPolicy;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn rad_seed_and_follow() {
|
fn rad_seed_and_follow() {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
use std::str::FromStr as _;
|
use std::str::FromStr as _;
|
||||||
|
|
||||||
|
use radicle::node::Handle as _;
|
||||||
use radicle::node::config::DefaultSeedingPolicy;
|
use radicle::node::config::DefaultSeedingPolicy;
|
||||||
use radicle::node::policy::Scope;
|
use radicle::node::policy::Scope;
|
||||||
use radicle::node::Handle as _;
|
|
||||||
use radicle::prelude::RepoId;
|
use radicle::prelude::RepoId;
|
||||||
use radicle::storage::{ReadStorage as _, RemoteRepository as _};
|
use radicle::storage::{ReadStorage as _, RemoteRepository as _};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use std::str::FromStr as _;
|
use std::str::FromStr as _;
|
||||||
|
|
||||||
use radicle::node::policy::Scope;
|
|
||||||
use radicle::node::DEFAULT_TIMEOUT;
|
use radicle::node::DEFAULT_TIMEOUT;
|
||||||
|
use radicle::node::policy::Scope;
|
||||||
use radicle::node::{Alias, Handle as _};
|
use radicle::node::{Alias, Handle as _};
|
||||||
use radicle::prelude::RepoId;
|
use radicle::prelude::RepoId;
|
||||||
use radicle::profile;
|
use radicle::profile;
|
||||||
|
|
@ -36,11 +36,13 @@ fn rad_config() {
|
||||||
let mut environment = Environment::new();
|
let mut environment = Environment::new();
|
||||||
let alias = Alias::new("alice");
|
let alias = Alias::new("alice");
|
||||||
let profile = environment.profile_with(profile::Config {
|
let profile = environment.profile_with(profile::Config {
|
||||||
preferred_seeds: vec![radicle::node::config::seeds::RADICLE_NODE_BOOTSTRAP_IRIS
|
preferred_seeds: vec![
|
||||||
|
radicle::node::config::seeds::RADICLE_NODE_BOOTSTRAP_IRIS
|
||||||
.clone()
|
.clone()
|
||||||
.first()
|
.first()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.clone()],
|
.clone(),
|
||||||
|
],
|
||||||
..profile::Config::new(alias)
|
..profile::Config::new(alias)
|
||||||
});
|
});
|
||||||
let working = tempfile::tempdir().unwrap();
|
let working = tempfile::tempdir().unwrap();
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ use std::path::PathBuf;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use radicle::cob::cache::COBS_DB_FILE;
|
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::crypto::{KeyPair, Seed};
|
||||||
use radicle::git;
|
use radicle::git;
|
||||||
use radicle::node::policy::store as policy;
|
use radicle::node::policy::store as policy;
|
||||||
|
|
@ -47,10 +47,9 @@ pub(crate) mod config {
|
||||||
},
|
},
|
||||||
..Limits::default()
|
..Limits::default()
|
||||||
},
|
},
|
||||||
external_addresses: vec![node::Address::from_str(&format!(
|
external_addresses: vec![
|
||||||
"{alias}.radicle.example:8776"
|
node::Address::from_str(&format!("{alias}.radicle.example:8776")).unwrap(),
|
||||||
))
|
],
|
||||||
.unwrap()],
|
|
||||||
..node(alias)
|
..node(alias)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,10 @@ use crate::change::store::Version;
|
||||||
use crate::signatures;
|
use crate::signatures;
|
||||||
use crate::trailers::CommitTrailer;
|
use crate::trailers::CommitTrailer;
|
||||||
use crate::{
|
use crate::{
|
||||||
change,
|
Embed, change,
|
||||||
change::{store, Contents, Entry, Timestamp},
|
change::{Contents, Entry, Timestamp, store},
|
||||||
signatures::{ExtendedSignature, Signatures},
|
signatures::{ExtendedSignature, Signatures},
|
||||||
trailers, Embed,
|
trailers,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::commit::Commit;
|
use super::commit::Commit;
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ use std::str::{self, FromStr};
|
||||||
use git2::{ObjectType, Oid};
|
use git2::{ObjectType, Oid};
|
||||||
|
|
||||||
use metadata::author::Author;
|
use metadata::author::Author;
|
||||||
|
use metadata::commit::CommitData;
|
||||||
use metadata::commit::headers::Headers;
|
use metadata::commit::headers::Headers;
|
||||||
use metadata::commit::trailers::OwnedTrailer;
|
use metadata::commit::trailers::OwnedTrailer;
|
||||||
use metadata::commit::CommitData;
|
|
||||||
|
|
||||||
use trailers::Trailers;
|
use trailers::Trailers;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ use oid::Oid;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::object::collaboration::error::{Create, Update};
|
use crate::object::collaboration::error::{Create, Update};
|
||||||
use crate::{signatures, TypeName};
|
use crate::{TypeName, signatures};
|
||||||
|
|
||||||
/// Change entry storage.
|
/// Change entry storage.
|
||||||
pub trait Storage {
|
pub trait Storage {
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ use dag::Dag;
|
||||||
use oid::Oid;
|
use oid::Oid;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
change, object, object::collaboration::Evaluate, signatures::ExtendedSignature,
|
CollaborativeObject, Entry, EntryId, History, ObjectId, TypeName, change, object,
|
||||||
CollaborativeObject, Entry, EntryId, History, ObjectId, TypeName,
|
object::collaboration::Evaluate, signatures::ExtendedSignature,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, thiserror::Error)]
|
||||||
|
|
|
||||||
|
|
@ -77,8 +77,8 @@ mod change_graph;
|
||||||
mod trailers;
|
mod trailers;
|
||||||
|
|
||||||
pub mod change;
|
pub mod change;
|
||||||
pub use change::store::{Contents, Embed, EntryId, Manifest, Version};
|
|
||||||
pub use change::Entry;
|
pub use change::Entry;
|
||||||
|
pub use change::store::{Contents, Embed, EntryId, Manifest, Version};
|
||||||
|
|
||||||
pub mod history;
|
pub mod history;
|
||||||
pub use history::History;
|
pub use history::History;
|
||||||
|
|
@ -91,8 +91,8 @@ pub use type_name::TypeName;
|
||||||
|
|
||||||
pub mod object;
|
pub mod object;
|
||||||
pub use object::{
|
pub use object::{
|
||||||
create, get, info, list, remove, update, CollaborativeObject, Create, Evaluate, ObjectId,
|
CollaborativeObject, Create, Evaluate, ObjectId, Update, Updated, create, get, info, list,
|
||||||
Update, Updated,
|
remove, update,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ use thiserror::Error;
|
||||||
|
|
||||||
pub mod collaboration;
|
pub mod collaboration;
|
||||||
pub use collaboration::{
|
pub use collaboration::{
|
||||||
create, get, info, list, parse_refstr, remove, update, CollaborativeObject, Create, Evaluate,
|
CollaborativeObject, Create, Evaluate, Update, Updated, create, get, info, list, parse_refstr,
|
||||||
Update, Updated,
|
remove, update,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub mod storage;
|
pub mod storage;
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,12 @@ use nonempty::NonEmpty;
|
||||||
use oid::Oid;
|
use oid::Oid;
|
||||||
|
|
||||||
use crate::change::store::{Manifest, Version};
|
use crate::change::store::{Manifest, Version};
|
||||||
use crate::{change, Entry, History, ObjectId, TypeName};
|
use crate::{Entry, History, ObjectId, TypeName, change};
|
||||||
|
|
||||||
pub mod error;
|
pub mod error;
|
||||||
|
|
||||||
mod create;
|
mod create;
|
||||||
pub use create::{create, Create};
|
pub use create::{Create, create};
|
||||||
|
|
||||||
mod get;
|
mod get;
|
||||||
pub use get::get;
|
pub use get::get;
|
||||||
|
|
@ -25,7 +25,7 @@ mod remove;
|
||||||
pub use remove::remove;
|
pub use remove::remove;
|
||||||
|
|
||||||
mod update;
|
mod update;
|
||||||
pub use update::{update, Update, Updated};
|
pub use update::{Update, Updated, update};
|
||||||
|
|
||||||
/// A collaborative object
|
/// A collaborative object
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
use crypto::ssh::ExtendedSignature;
|
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;
|
use super::error;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ use std::collections::BTreeSet;
|
||||||
use crypto::ssh::ExtendedSignature;
|
use crypto::ssh::ExtendedSignature;
|
||||||
use oid::Oid;
|
use oid::Oid;
|
||||||
|
|
||||||
use crate::{change_graph::ChangeGraph, ObjectId, TypeName};
|
use crate::{ObjectId, TypeName, change_graph::ChangeGraph};
|
||||||
|
|
||||||
use super::error;
|
use super::error;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright © 2022 The Radicle Link Contributors
|
// 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;
|
use super::error;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ use nonempty::NonEmpty;
|
||||||
use oid::Oid;
|
use oid::Oid;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
change, change_graph::ChangeGraph, history::EntryId, CollaborativeObject, Embed, Evaluate,
|
CollaborativeObject, Embed, Evaluate, ExtendedSignature, ObjectId, TypeName, change,
|
||||||
ExtendedSignature, ObjectId, TypeName,
|
change_graph::ChangeGraph, history::EntryId,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::error;
|
use super::error;
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,10 @@ use std::{
|
||||||
ops::{Deref, DerefMut},
|
ops::{Deref, DerefMut},
|
||||||
};
|
};
|
||||||
|
|
||||||
use crypto::{ssh, PublicKey};
|
use crypto::{PublicKey, ssh};
|
||||||
use metadata::commit::{
|
use metadata::commit::{
|
||||||
headers::Signature::{Pgp, Ssh},
|
|
||||||
CommitData,
|
CommitData,
|
||||||
|
headers::Signature::{Pgp, Ssh},
|
||||||
};
|
};
|
||||||
|
|
||||||
pub use ssh::ExtendedSignature;
|
pub use ssh::ExtendedSignature;
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ use fmt::Component;
|
||||||
use tempfile::TempDir;
|
use tempfile::TempDir;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
change,
|
ObjectId, Store, change,
|
||||||
object::{self, Reference},
|
object::{self, Reference},
|
||||||
signatures, ObjectId, Store,
|
signatures,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub mod error {
|
pub mod error {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ use fmt::{Component, RefString};
|
||||||
|
|
||||||
use radicle_git_ref_format::refname;
|
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")]
|
#[cfg(feature = "git2")]
|
||||||
mod git {
|
mod git {
|
||||||
|
|
@ -10,11 +10,11 @@ mod git {
|
||||||
|
|
||||||
use crypto::test::signer::MockSigner;
|
use crypto::test::signer::MockSigner;
|
||||||
use crypto::{PublicKey, Signer};
|
use crypto::{PublicKey, Signer};
|
||||||
use nonempty::{nonempty, NonEmpty};
|
use nonempty::{NonEmpty, nonempty};
|
||||||
use qcheck::Arbitrary;
|
use qcheck::Arbitrary;
|
||||||
|
|
||||||
use crate::{
|
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;
|
use crate::test;
|
||||||
|
|
|
||||||
|
|
@ -116,15 +116,19 @@ mod test {
|
||||||
assert!(TypeName::from_str("abc..ghi").is_err());
|
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("abc.123-.ghi").is_err());
|
assert!(TypeName::from_str("abc.123-.ghi").is_err());
|
||||||
assert!(TypeName::from_str(&format!(
|
assert!(
|
||||||
|
TypeName::from_str(&format!(
|
||||||
"a.very.long.name.that.exceeds.the.two-hundred-and-fifty-five.length.limit.{}",
|
"a.very.long.name.that.exceeds.the.two-hundred-and-fifty-five.length.limit.{}",
|
||||||
"a".repeat(255)
|
"a".repeat(255)
|
||||||
))
|
))
|
||||||
.is_err());
|
.is_err()
|
||||||
assert!(TypeName::from_str(&format!(
|
);
|
||||||
|
assert!(
|
||||||
|
TypeName::from_str(&format!(
|
||||||
"component.exceeds.sixty-three.limit.{}",
|
"component.exceeds.sixty-three.limit.{}",
|
||||||
"a".repeat(64)
|
"a".repeat(64)
|
||||||
))
|
))
|
||||||
.is_err());
|
.is_err()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -219,7 +219,7 @@ mod radicle_git_ref_format_impls {
|
||||||
mod serde_impls {
|
mod serde_impls {
|
||||||
use alloc::string::String;
|
use alloc::string::String;
|
||||||
|
|
||||||
use serde::{de, Deserialize, Deserializer, Serialize};
|
use serde::{Deserialize, Deserializer, Serialize, de};
|
||||||
|
|
||||||
use super::RepoId;
|
use super::RepoId;
|
||||||
|
|
||||||
|
|
@ -347,48 +347,72 @@ mod test {
|
||||||
fn invalid() {
|
fn invalid() {
|
||||||
assert!("".parse::<RepoId>().is_err());
|
assert!("".parse::<RepoId>().is_err());
|
||||||
assert!("not-a-valid-rid".parse::<RepoId>().is_err());
|
assert!("not-a-valid-rid".parse::<RepoId>().is_err());
|
||||||
assert!("xyz:z3gqcJUoA1n9HaHKufZs5FCSGazv5"
|
assert!(
|
||||||
|
"xyz:z3gqcJUoA1n9HaHKufZs5FCSGazv5"
|
||||||
.parse::<RepoId>()
|
.parse::<RepoId>()
|
||||||
.is_err());
|
.is_err()
|
||||||
assert!("RAD:z3gqcJUoA1n9HaHKufZs5FCSGazv5"
|
);
|
||||||
|
assert!(
|
||||||
|
"RAD:z3gqcJUoA1n9HaHKufZs5FCSGazv5"
|
||||||
.parse::<RepoId>()
|
.parse::<RepoId>()
|
||||||
.is_err());
|
.is_err()
|
||||||
|
);
|
||||||
assert!("rad:".parse::<RepoId>().is_err());
|
assert!("rad:".parse::<RepoId>().is_err());
|
||||||
assert!("rad:z3gqcJUoA1n9HaHKufZs5FCSG0zv5"
|
assert!(
|
||||||
|
"rad:z3gqcJUoA1n9HaHKufZs5FCSG0zv5"
|
||||||
.parse::<RepoId>()
|
.parse::<RepoId>()
|
||||||
.is_err());
|
.is_err()
|
||||||
assert!("rad:z3gqcJUoA1n9HaHKufZs5FCSGOzv5"
|
);
|
||||||
|
assert!(
|
||||||
|
"rad:z3gqcJUoA1n9HaHKufZs5FCSGOzv5"
|
||||||
.parse::<RepoId>()
|
.parse::<RepoId>()
|
||||||
.is_err());
|
.is_err()
|
||||||
assert!("rad:z3gqcJUoA1n9HaHKufZs5FCSGIzv5"
|
);
|
||||||
|
assert!(
|
||||||
|
"rad:z3gqcJUoA1n9HaHKufZs5FCSGIzv5"
|
||||||
.parse::<RepoId>()
|
.parse::<RepoId>()
|
||||||
.is_err());
|
.is_err()
|
||||||
assert!("rad:z3gqcJUoA1n9HaHKufZs5FCSGlzv5"
|
);
|
||||||
|
assert!(
|
||||||
|
"rad:z3gqcJUoA1n9HaHKufZs5FCSGlzv5"
|
||||||
.parse::<RepoId>()
|
.parse::<RepoId>()
|
||||||
.is_err());
|
.is_err()
|
||||||
assert!("rad:z3gqcJUoA1n9HaHKufZs5FCSGázv5"
|
);
|
||||||
|
assert!(
|
||||||
|
"rad:z3gqcJUoA1n9HaHKufZs5FCSGázv5"
|
||||||
.parse::<RepoId>()
|
.parse::<RepoId>()
|
||||||
.is_err());
|
.is_err()
|
||||||
assert!("rad:z3gqcJUoA1n9HaHKufZs5FCSG@zv5"
|
);
|
||||||
|
assert!(
|
||||||
|
"rad:z3gqcJUoA1n9HaHKufZs5FCSG@zv5"
|
||||||
.parse::<RepoId>()
|
.parse::<RepoId>()
|
||||||
.is_err());
|
.is_err()
|
||||||
assert!("rad:Z3gqcJUoA1n9HaHKufZs5FCSGazv5"
|
);
|
||||||
|
assert!(
|
||||||
|
"rad:Z3gqcJUoA1n9HaHKufZs5FCSGazv5"
|
||||||
.parse::<RepoId>()
|
.parse::<RepoId>()
|
||||||
.is_err());
|
.is_err()
|
||||||
|
);
|
||||||
assert!("rad:z3gqcJUoA1n9HaHKuf".parse::<RepoId>().is_err());
|
assert!("rad:z3gqcJUoA1n9HaHKuf".parse::<RepoId>().is_err());
|
||||||
assert!("rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5abcdef"
|
assert!(
|
||||||
|
"rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5abcdef"
|
||||||
.parse::<RepoId>()
|
.parse::<RepoId>()
|
||||||
.is_err());
|
.is_err()
|
||||||
assert!("rad: z3gqcJUoA1n9HaHKufZs5FCSGazv5"
|
);
|
||||||
|
assert!(
|
||||||
|
"rad: z3gqcJUoA1n9HaHKufZs5FCSGazv5"
|
||||||
.parse::<RepoId>()
|
.parse::<RepoId>()
|
||||||
.is_err());
|
.is_err()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn valid() {
|
fn valid() {
|
||||||
assert!("rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5"
|
assert!(
|
||||||
|
"rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5"
|
||||||
.parse::<RepoId>()
|
.parse::<RepoId>()
|
||||||
.is_ok());
|
.is_ok()
|
||||||
|
);
|
||||||
assert!("z3gqcJUoA1n9HaHKufZs5FCSGazv5".parse::<RepoId>().is_ok());
|
assert!("z3gqcJUoA1n9HaHKufZs5FCSGazv5".parse::<RepoId>().is_ok());
|
||||||
assert!("z3XncAdkZjeK9mQS5Sdc4qhw98BUX".parse::<RepoId>().is_ok());
|
assert!("z3XncAdkZjeK9mQS5Sdc4qhw98BUX".parse::<RepoId>().is_ok());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ use ec25519 as ed25519;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
pub use ed25519::{edwards25519, Error, KeyPair, Seed};
|
pub use ed25519::{Error, KeyPair, Seed, edwards25519};
|
||||||
|
|
||||||
pub extern crate signature;
|
pub extern crate signature;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use qcheck::Arbitrary;
|
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 {
|
impl Arbitrary for MockSigner {
|
||||||
fn arbitrary(g: &mut qcheck::Gen) -> Self {
|
fn arbitrary(g: &mut qcheck::Gen) -> Self {
|
||||||
|
|
|
||||||
|
|
@ -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)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct MockSigner {
|
pub struct MockSigner {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use radicle::git::fmt::{Component, Qualified, RefString};
|
|
||||||
use radicle::git::Oid;
|
use radicle::git::Oid;
|
||||||
|
use radicle::git::fmt::{Component, Qualified, RefString};
|
||||||
use radicle::prelude::PublicKey;
|
use radicle::prelude::PublicKey;
|
||||||
|
|
||||||
use super::refs::{Applied, RefUpdate, Update};
|
use super::refs::{Applied, RefUpdate, Update};
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
|
||||||
use either::Either;
|
use either::Either;
|
||||||
use radicle::git::fmt::{Namespaced, Qualified};
|
|
||||||
use radicle::git::Oid;
|
use radicle::git::Oid;
|
||||||
|
use radicle::git::fmt::{Namespaced, Qualified};
|
||||||
use radicle::prelude::PublicKey;
|
use radicle::prelude::PublicKey;
|
||||||
|
|
||||||
pub use radicle::storage::RefUpdate;
|
pub use radicle::storage::RefUpdate;
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,8 @@ pub mod error;
|
||||||
use either::Either;
|
use either::Either;
|
||||||
use radicle::git::raw::ErrorExt as _;
|
use radicle::git::raw::ErrorExt as _;
|
||||||
use radicle::git::{
|
use radicle::git::{
|
||||||
self,
|
self, Oid,
|
||||||
fmt::{Namespaced, Qualified},
|
fmt::{Namespaced, Qualified},
|
||||||
Oid,
|
|
||||||
};
|
};
|
||||||
use radicle::storage::git::Repository;
|
use radicle::storage::git::Repository;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
use radicle::git::{
|
use radicle::git::{
|
||||||
self,
|
self, Oid,
|
||||||
fmt::{Namespaced, Qualified},
|
fmt::{Namespaced, Qualified},
|
||||||
Oid,
|
|
||||||
};
|
};
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
use std::sync::atomic::{self, AtomicBool};
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
use std::sync::atomic::{self, AtomicBool};
|
||||||
|
|
||||||
use bstr::BString;
|
use bstr::BString;
|
||||||
use radicle::crypto::PublicKey;
|
use radicle::crypto::PublicKey;
|
||||||
use radicle::git::Oid;
|
use radicle::git::Oid;
|
||||||
use radicle::identity::{Doc, DocError};
|
use radicle::identity::{Doc, DocError};
|
||||||
use radicle::storage::git::Repository;
|
|
||||||
use radicle::storage::ReadRepository;
|
use radicle::storage::ReadRepository;
|
||||||
|
use radicle::storage::git::Repository;
|
||||||
|
|
||||||
use crate::policy::{Allowed, BlockList};
|
use crate::policy::{Allowed, BlockList};
|
||||||
use crate::transport::{ConnectionStream, Transport};
|
use crate::transport::{ConnectionStream, Transport};
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,9 @@ mod state;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::time::Instant;
|
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 handle::Handle;
|
||||||
pub use policy::{Allowed, BlockList, Scope};
|
pub use policy::{Allowed, BlockList, Scope};
|
||||||
use radicle::storage::git::Repository;
|
use radicle::storage::git::Repository;
|
||||||
|
|
@ -22,8 +22,8 @@ pub use state::{Config, FetchLimit, FetchResult};
|
||||||
pub use transport::Transport;
|
pub use transport::Transport;
|
||||||
|
|
||||||
use radicle::crypto::PublicKey;
|
use radicle::crypto::PublicKey;
|
||||||
use radicle::storage::refs::RefsAt;
|
|
||||||
use radicle::storage::ReadRepository as _;
|
use radicle::storage::ReadRepository as _;
|
||||||
|
use radicle::storage::refs::RefsAt;
|
||||||
use state::FetchState;
|
use state::FetchState;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,8 @@ use bstr::{BString, ByteSlice};
|
||||||
use either::Either;
|
use either::Either;
|
||||||
use radicle::crypto::PublicKey;
|
use radicle::crypto::PublicKey;
|
||||||
use radicle::git::{
|
use radicle::git::{
|
||||||
self,
|
self, Oid,
|
||||||
fmt::{Component, Namespaced, Qualified},
|
fmt::{Component, Namespaced, Qualified},
|
||||||
Oid,
|
|
||||||
};
|
};
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ use std::collections::BTreeMap;
|
||||||
use std::ops::Not as _;
|
use std::ops::Not as _;
|
||||||
|
|
||||||
pub use radicle::storage::refs::SignedRefs;
|
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};
|
use radicle::{crypto::PublicKey, storage::ValidateRepository};
|
||||||
|
|
||||||
pub mod error {
|
pub mod error {
|
||||||
|
|
|
||||||
|
|
@ -37,10 +37,10 @@ use either::Either;
|
||||||
use gix_protocol::handshake::Ref;
|
use gix_protocol::handshake::Ref;
|
||||||
use nonempty::NonEmpty;
|
use nonempty::NonEmpty;
|
||||||
use radicle::crypto::PublicKey;
|
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::git::Repository;
|
||||||
use radicle::storage::refs::{RefsAt, Special};
|
use radicle::storage::refs::{RefsAt, Special};
|
||||||
use radicle::storage::ReadRepository;
|
|
||||||
|
|
||||||
use crate::git::refs::{Policy, Update, Updates};
|
use crate::git::refs::{Policy, Update, Updates};
|
||||||
use crate::policy::BlockList;
|
use crate::policy::BlockList;
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,14 @@ use std::time::Instant;
|
||||||
|
|
||||||
use gix_protocol::Handshake;
|
use gix_protocol::Handshake;
|
||||||
use radicle::crypto::PublicKey;
|
use radicle::crypto::PublicKey;
|
||||||
use radicle::git::{fmt::Qualified, Oid};
|
use radicle::git::{Oid, fmt::Qualified};
|
||||||
use radicle::identity::{Did, Doc, DocError};
|
use radicle::identity::{Did, Doc, DocError};
|
||||||
|
|
||||||
use radicle::storage;
|
use radicle::storage;
|
||||||
use radicle::storage::git::Repository;
|
use radicle::storage::git::Repository;
|
||||||
use radicle::storage::refs::{FeatureLevel, RefsAt};
|
use radicle::storage::refs::{FeatureLevel, RefsAt};
|
||||||
use radicle::storage::{
|
use radicle::storage::{
|
||||||
git::Validation, Remote, RemoteId, RemoteRepository, Remotes, ValidateRepository, Validations,
|
Remote, RemoteId, RemoteRepository, Remotes, ValidateRepository, Validations, git::Validation,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::git;
|
use crate::git;
|
||||||
|
|
@ -20,7 +20,7 @@ use crate::git::repository;
|
||||||
use crate::sigrefs::SignedRefs;
|
use crate::sigrefs::SignedRefs;
|
||||||
use crate::stage;
|
use crate::stage;
|
||||||
use crate::stage::ProtocolStage;
|
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,
|
/// The data size limit, 5Mb, while fetching the special refs,
|
||||||
/// i.e. `rad/id` and `rad/sigrefs`.
|
/// i.e. `rad/id` and `rad/sigrefs`.
|
||||||
|
|
@ -549,9 +549,13 @@ impl FetchState {
|
||||||
}) => {
|
}) => {
|
||||||
let level_required = levels.max();
|
let level_required = levels.max();
|
||||||
if level_reachable >= level_required {
|
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 {
|
} 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);
|
self.prune(&remote);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -601,9 +605,13 @@ impl FetchState {
|
||||||
}) => {
|
}) => {
|
||||||
let level_required = levels.max();
|
let level_required = levels.max();
|
||||||
if level_reachable >= level_required {
|
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 {
|
} 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);
|
self.prune(&remote);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -629,7 +637,10 @@ impl FetchState {
|
||||||
}
|
}
|
||||||
|
|
||||||
if level_reachable < FeatureLevel::LATEST {
|
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
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,18 +4,18 @@ pub(crate) mod ls_refs;
|
||||||
use std::collections::BTreeSet;
|
use std::collections::BTreeSet;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::sync::atomic::AtomicBool;
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
use std::sync::atomic::AtomicBool;
|
||||||
|
|
||||||
use bstr::BString;
|
use bstr::BString;
|
||||||
use gix_features::progress::prodash::progress;
|
use gix_features::progress::prodash::progress;
|
||||||
use gix_protocol::handshake;
|
|
||||||
use gix_protocol::Handshake;
|
use gix_protocol::Handshake;
|
||||||
use gix_transport::client;
|
use gix_protocol::handshake;
|
||||||
use gix_transport::Protocol;
|
use gix_transport::Protocol;
|
||||||
use gix_transport::Service;
|
use gix_transport::Service;
|
||||||
use radicle::git::fmt::Qualified;
|
use gix_transport::client;
|
||||||
use radicle::git::Oid;
|
use radicle::git::Oid;
|
||||||
|
use radicle::git::fmt::Qualified;
|
||||||
use radicle::storage::git::Repository;
|
use radicle::storage::git::Repository;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::sync::{atomic::AtomicBool, Arc};
|
use std::sync::{Arc, atomic::AtomicBool};
|
||||||
|
|
||||||
use gix_features::progress::{DynNestedProgress, NestedProgress};
|
use gix_features::progress::{DynNestedProgress, NestedProgress};
|
||||||
use gix_pack as pack;
|
use gix_pack as pack;
|
||||||
use gix_protocol::fetch::negotiate::one_round::State;
|
use gix_protocol::fetch::negotiate::one_round::State;
|
||||||
use gix_protocol::handshake::Ref;
|
use gix_protocol::handshake::Ref;
|
||||||
use gix_protocol::{fetch, Handshake};
|
use gix_protocol::{Handshake, fetch};
|
||||||
|
|
||||||
use crate::git::packfile;
|
use crate::git::packfile;
|
||||||
|
|
||||||
use super::{agent_name, Connection, WantsHaves};
|
use super::{Connection, WantsHaves, agent_name};
|
||||||
|
|
||||||
pub type Error = fetch::Error;
|
pub type Error = fetch::Error;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,12 @@ use std::io;
|
||||||
use gix_features::progress::Progress;
|
use gix_features::progress::Progress;
|
||||||
use gix_protocol::handshake::Ref;
|
use gix_protocol::handshake::Ref;
|
||||||
use gix_protocol::transport::Protocol;
|
use gix_protocol::transport::Protocol;
|
||||||
use gix_protocol::{ls_refs, Handshake};
|
use gix_protocol::{Handshake, ls_refs};
|
||||||
use gix_transport::bstr::BString;
|
use gix_transport::bstr::BString;
|
||||||
|
|
||||||
use crate::stage::RefPrefix;
|
use crate::stage::RefPrefix;
|
||||||
|
|
||||||
use super::{agent_name, Connection};
|
use super::{Connection, agent_name};
|
||||||
|
|
||||||
/// Configuration for running an ls-refs process.
|
/// Configuration for running an ls-refs process.
|
||||||
///
|
///
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ use std::borrow::Cow;
|
||||||
use crate::author::Author;
|
use crate::author::Author;
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
|
CommitData,
|
||||||
headers::Headers,
|
headers::Headers,
|
||||||
trailers::{OwnedTrailer, Token, Trailer},
|
trailers::{OwnedTrailer, Token, Trailer},
|
||||||
CommitData,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, thiserror::Error)]
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::commit::parse::{parse, ParseError};
|
use crate::commit::parse::{ParseError, parse};
|
||||||
|
|
||||||
/// Helper type whose FromStr always fails.
|
/// Helper type whose FromStr always fails.
|
||||||
///
|
///
|
||||||
|
|
|
||||||
|
|
@ -142,9 +142,11 @@ This line is not a valid trailer."#;
|
||||||
|
|
||||||
assert_eq!(commit.trailers().count(), 0);
|
assert_eq!(commit.trailers().count(), 0);
|
||||||
assert!(commit.message().contains("Signed-off-by"));
|
assert!(commit.message().contains("Signed-off-by"));
|
||||||
assert!(commit
|
assert!(
|
||||||
|
commit
|
||||||
.message()
|
.message()
|
||||||
.contains("This line is not a valid trailer."));
|
.contains("This line is not a valid trailer.")
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue