##// END OF EJS Templates
stream-clone-test: simplify the case where server disabled it...
stream-clone-test: simplify the case where server disabled it We have an option to disable it, we don't need to test it with all protocol variants. In addition there is little value in looking at the bytes to bytes details of the reply. Such check is very fragile and consume a lot of time for little value when adjusting formats, caches, and protocol.

File last commit:

r51759:c112cc9e default
r52365:749e7685 default
Show More
lib.rs
144 lines | 4.2 KiB | application/rls-services+xml | RustLexer
Georges Racinet
rust-core: updated copyright notice...
r44455 // Copyright 2018-2020 Georges Racinet <georges.racinet@octobus.net>
// and Mercurial contributors
Georges Racinet
rust: pure Rust lazyancestors iterator...
r40307 //
// This software may be used and distributed according to the terms of the
// GNU General Public License version 2 or any later version.
Simon Sapin
rust: use HgError in RevlogError and Vfs...
r47172
Georges Racinet
rust: pure Rust lazyancestors iterator...
r40307 mod ancestors;
Georges Racinet on ishtar.racinet.fr
rust: dagop.headrevs() Rust counterparts...
r41278 pub mod dagops;
Simon Sapin
rust: Introduce an `HgError` enum for common error cases...
r47167 pub mod errors;
Raphaël Gomès
rhg-status: add support for narrow clones
r50383 pub mod narrow;
Raphaël Gomès
rhg: add sparse support
r50380 pub mod sparse;
pacien
hg-core: dedup LazyAncestors Iterator impl...
r49351 pub use ancestors::{AncestorsIterator, MissingAncestors};
Simon Sapin
rust: Add a Timestamp struct instead of abusing Duration...
r47871 pub mod dirstate;
Simon Sapin
dirstate-tree: Make Rust DirstateMap bindings go through a trait object...
r47863 pub mod dirstate_tree;
Georges Racinet
rust-discovery: starting core implementation...
r42355 pub mod discovery;
Pulkit Goyal
rhg: add exit code to HgError::Abort()...
r48199 pub mod exit_codes;
Simon Sapin
requirements: move loading to hg-core and add parsing...
r46536 pub mod requirements;
Raphaël Gomès
rust-dirstate: add rust-cpython bindings to the new parse/pack functions...
r42489 pub mod testing; // unconditionally built, for use from integration tests
pub use dirstate::{
Yuya Nishihara
rust-dirstate: specify concrete return type of DirsMultiset::iter()...
r43155 dirs_multiset::{DirsMultiset, DirsMultisetIter},
Raphaël Gomès
rust-status: add bare `hg status` support in hg-core...
r45015 status::{
Simon Sapin
dirstate: Remove the flat Rust DirstateMap implementation...
r48882 BadMatch, BadType, DirstateStatus, HgPathCow, StatusError,
Simon Sapin
rhg: Add more conversions between error types...
r47555 StatusOptions,
Raphaël Gomès
rust-status: add bare `hg status` support in hg-core...
r45015 },
Simon Sapin
dirstate: Remove the flat Rust DirstateMap implementation...
r48882 DirstateEntry, DirstateParents, EntryState,
Raphaël Gomès
rust-dirstate: add rust-cpython bindings to the new parse/pack functions...
r42489 };
copies: introduce a basic Rust function for `combine_changeset_copies`...
r46556 pub mod copy_tracing;
Spencer Baugh
rhg: support "status FILE"...
r51759 pub mod filepatterns;
Raphaël Gomès
rust-matchers: add `Matcher` trait and implement `AlwaysMatcher`...
r43742 pub mod matchers;
Simon Sapin
rust: introduce Repo and Vfs types for filesystem abstraction...
r46782 pub mod repo;
Georges Racinet
rust-core: extracted a revlog submodule...
r44457 pub mod revlog;
pub use revlog::*;
Arseniy Alekseyev
rhg: implement checkexec to support weird filesystems...
r50789 pub mod checkexec;
Raphaël Gomès
hg-core: add basic config module...
r46803 pub mod config;
Simon Sapin
rhg: Initial repository locking...
r49245 pub mod lock;
Simon Sapin
rust: Add a log file rotation utility...
r47341 pub mod logging;
Antoine Cezar
hg-core: add Operation interface for high-level hg operations...
r45501 pub mod operations;
Simon Sapin
rhg: centralize parsing of `--rev` CLI arguments...
r47162 pub mod revset;
Raphaël Gomès
rust-utils: add docstrings and doctests for utils.rs...
r42829 pub mod utils;
Simon Sapin
rust: Move VFS code to its own module...
r48764 pub mod vfs;
Raphaël Gomès
rust-filepatterns: add a Rust implementation of pattern-related utils...
r42514
Raphaël Gomès
rust-dirs-multiset: improve temporary error message...
r44765 use crate::utils::hg_path::{HgPathBuf, HgPathError};
Raphaël Gomès
rust-filepatterns: add a Rust implementation of pattern-related utils...
r42514 pub use filepatterns::{
Raphaël Gomès
rust-filepatterns: improve API and robustness for pattern files parsing...
r44784 parse_pattern_syntax, read_pattern_file, IgnorePattern,
PatternFileWarning, PatternSyntax,
Raphaël Gomès
rust-filepatterns: add a Rust implementation of pattern-related utils...
r42514 };
Raphaël Gomès
rust-performance: introduce FastHashMap type alias for HashMap...
r44278 use std::collections::HashMap;
Simon Sapin
rust: replace ToString impls with Display...
r47173 use std::fmt;
Raphaël Gomès
rust-performance: introduce FastHashMap type alias for HashMap...
r44278 use twox_hash::RandomXxHashBuilder64;
Georges Racinet
rust: pure Rust lazyancestors iterator...
r40307
Raphaël Gomès
rust-filepatterns: add a Rust implementation of pattern-related utils...
r42514 pub type LineNumber = usize;
Raphaël Gomès
rust-performance: introduce FastHashMap type alias for HashMap...
r44278 /// Rust's default hasher is too slow because it tries to prevent collision
/// attacks. We are not concerned about those: if an ill-minded person has
/// write access to your repository, you have other issues.
pub type FastHashMap<K, V> = HashMap<K, V, RandomXxHashBuilder64>;
Simon Sapin
dirstate-tree: optimize HashMap lookups with raw_entry_mut...
r49805 // TODO: should this be the default `FastHashMap` for all of hg-core, not just
// dirstate_tree? How does XxHash compare with AHash, hashbrown’s default?
pub type FastHashbrownMap<K, V> =
hashbrown::HashMap<K, V, RandomXxHashBuilder64>;
Raphaël Gomès
rust-dirstate: add rust implementation of `parse_dirstate` and `pack_dirstate`...
r42488 #[derive(Debug, PartialEq)]
Raphaël Gomès
rust-dirstate: add "dirs" Rust implementation...
r42736 pub enum DirstateMapError {
Raphaël Gomès
rust-hgpath: replace all paths and filenames with HgPath/HgPathBuf...
r43227 PathNotFound(HgPathBuf),
Raphaël Gomès
rust-dirs-multiset: improve temporary error message...
r44765 InvalidPath(HgPathError),
Raphaël Gomès
rust-dirs: address failing tests for `dirs` impl with a temporary fix...
r44227 }
Spencer Baugh
rust: improve the type on DirsMultiset::from_manifest...
r51753 impl From<HgPathError> for DirstateMapError {
fn from(error: HgPathError) -> Self {
Self::InvalidPath(error)
}
}
Simon Sapin
rust: replace ToString impls with Display...
r47173 impl fmt::Display for DirstateMapError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
Raphaël Gomès
rust-dirs: address failing tests for `dirs` impl with a temporary fix...
r44227 match self {
Raphaël Gomès
rust-dirs-multiset: improve temporary error message...
r44765 DirstateMapError::PathNotFound(_) => {
Simon Sapin
rust: replace ToString impls with Display...
r47173 f.write_str("expected a value, found none")
Raphaël Gomès
rust-dirs: address failing tests for `dirs` impl with a temporary fix...
r44227 }
Simon Sapin
rust: replace ToString impls with Display...
r47173 DirstateMapError::InvalidPath(path_error) => path_error.fmt(f),
Raphaël Gomès
rust-dirs: address failing tests for `dirs` impl with a temporary fix...
r44227 }
}
Raphaël Gomès
rust-dirstate: add "dirs" Rust implementation...
r42736 }
Simon Sapin
rust: replace trivial `impl From …` with `#[derive(derive_more::From)]`...
r47164 #[derive(Debug, derive_more::From)]
Raphaël Gomès
rust-dirstate: use EntryState enum instead of literals...
r42994 pub enum DirstateError {
Map(DirstateMapError),
Simon Sapin
rust: Replace DirstatePackError with HgError...
r47168 Common(errors::HgError),
Raphaël Gomès
rust-dirstate: use EntryState enum instead of literals...
r42994 }
Spencer Baugh
rust: improve the type on DirsMultiset::from_manifest...
r51753 impl From<HgPathError> for DirstateError {
fn from(error: HgPathError) -> Self {
Self::Map(DirstateMapError::InvalidPath(error))
}
}
Simon Sapin
dirstate-v2: Make more APIs fallible, returning Result...
r48126 impl fmt::Display for DirstateError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
DirstateError::Map(error) => error.fmt(f),
DirstateError::Common(error) => error.fmt(f),
}
}
}
Simon Sapin
rust: replace trivial `impl From …` with `#[derive(derive_more::From)]`...
r47164 #[derive(Debug, derive_more::From)]
Raphaël Gomès
rust-filepatterns: add a Rust implementation of pattern-related utils...
r42514 pub enum PatternError {
Simon Sapin
rust: replace trivial `impl From …` with `#[derive(derive_more::From)]`...
r47164 #[from]
Raphaël Gomès
rust-filepatterns: improve API and robustness for pattern files parsing...
r44784 Path(HgPathError),
Raphaël Gomès
rust-filepatterns: add a Rust implementation of pattern-related utils...
r42514 UnsupportedSyntax(String),
Raphaël Gomès
rust-filepatterns: improve API and robustness for pattern files parsing...
r44784 UnsupportedSyntaxInFile(String, String, usize),
TooLong(usize),
Simon Sapin
rust: replace trivial `impl From …` with `#[derive(derive_more::From)]`...
r47164 #[from]
Raphaël Gomès
rust-filepatterns: improve API and robustness for pattern files parsing...
r44784 IO(std::io::Error),
Raphaël Gomès
rust-filepatterns: add support for `include` and `subinclude` patterns...
r44785 /// Needed a pattern that can be turned into a regex but got one that
/// can't. This should only happen through programmer error.
NonRegexPattern(IgnorePattern),
Raphaël Gomès
rust-filepatterns: add a Rust implementation of pattern-related utils...
r42514 }
Simon Sapin
rust: replace ToString impls with Display...
r47173 impl fmt::Display for PatternError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
Raphaël Gomès
rust-filepatterns: improve API and robustness for pattern files parsing...
r44784 match self {
PatternError::UnsupportedSyntax(syntax) => {
Simon Sapin
rust: replace ToString impls with Display...
r47173 write!(f, "Unsupported syntax {}", syntax)
Raphaël Gomès
rust-filepatterns: improve API and robustness for pattern files parsing...
r44784 }
PatternError::UnsupportedSyntaxInFile(syntax, file_path, line) => {
Simon Sapin
rust: replace ToString impls with Display...
r47173 write!(
f,
Raphaël Gomès
rust-filepatterns: improve API and robustness for pattern files parsing...
r44784 "{}:{}: unsupported syntax {}",
file_path, line, syntax
)
}
PatternError::TooLong(size) => {
Simon Sapin
rust: replace ToString impls with Display...
r47173 write!(f, "matcher pattern is too long ({} bytes)", size)
Raphaël Gomès
rust-filepatterns: improve API and robustness for pattern files parsing...
r44784 }
Simon Sapin
rust: replace ToString impls with Display...
r47173 PatternError::IO(error) => error.fmt(f),
PatternError::Path(error) => error.fmt(f),
Raphaël Gomès
rust-filepatterns: add support for `include` and `subinclude` patterns...
r44785 PatternError::NonRegexPattern(pattern) => {
Simon Sapin
rust: replace ToString impls with Display...
r47173 write!(f, "'{:?}' cannot be turned into a regex", pattern)
Raphaël Gomès
rust-filepatterns: add support for `include` and `subinclude` patterns...
r44785 }
Raphaël Gomès
rust-filepatterns: improve API and robustness for pattern files parsing...
r44784 }
Raphaël Gomès
rust-filepatterns: add a Rust implementation of pattern-related utils...
r42514 }
}