Skip to main content

jj_lib/
lib.rs

1// Copyright 2020 The Jujutsu Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Jujutsu version control system.
16
17#![warn(missing_docs)]
18#![deny(unused_must_use)]
19#![forbid(unsafe_code)]
20
21pub mod absorb;
22pub mod annotate;
23pub mod backend;
24pub mod bisect;
25pub mod commit;
26pub mod commit_builder;
27pub mod config;
28mod config_resolver;
29pub use jj_core::conflict_labels;
30pub mod conflicts;
31pub use jj_core::content_hash;
32pub mod converge;
33pub mod copies;
34pub use jj_core::dag_walk;
35pub use jj_core::dag_walk_async;
36pub mod default_backend_factories;
37pub mod default_index;
38pub mod default_submodule_store;
39pub use jj_core::diff;
40pub mod diff_presentation;
41pub mod dsl_util;
42pub(crate) mod eol;
43pub mod evolution;
44pub mod extensions_map;
45pub use jj_core::file_util;
46pub mod files;
47pub mod fileset;
48mod fileset_parser;
49pub mod fix;
50pub mod fmt_util;
51pub mod fsmonitor;
52#[cfg(feature = "git")]
53pub mod git;
54#[cfg(feature = "git")]
55pub mod git_backend;
56#[cfg(feature = "git")]
57mod git_subprocess;
58pub mod gitignore;
59pub mod gpg_signing;
60pub use jj_core::graph;
61pub mod graph_dominators;
62pub use jj_core::hex_util;
63pub mod id_prefix;
64pub mod index;
65pub mod iter_util;
66pub mod local_working_copy;
67pub mod lock;
68pub use jj_core::matchers;
69pub use jj_core::merge;
70pub mod merged_tree;
71pub mod merged_tree_builder;
72pub use jj_core::object_id;
73pub mod op_heads_store;
74pub mod op_store;
75pub mod op_walk;
76pub mod operation;
77#[expect(missing_docs)]
78pub mod protos;
79pub use jj_core::ref_name;
80pub mod refs;
81pub mod repo;
82pub use jj_core::repo_path;
83pub mod revset;
84mod revset_parser;
85pub mod rewrite;
86#[cfg(feature = "testing")]
87pub mod secret_backend;
88pub mod secure_config;
89pub mod settings;
90pub mod signing;
91use jj_core::symbol_util;
92pub mod tree_merge;
93// TODO: This file is mostly used for testing, whenever we no longer require it
94// in the lib it should be moved to the examples (e.g
95// "examples/simple-backend/").
96pub mod simple_backend;
97pub mod simple_op_heads_store;
98pub mod simple_op_store;
99pub mod ssh_signing;
100pub mod stacked_table;
101pub mod store;
102pub use jj_core::str_util;
103pub mod submodule_store;
104#[cfg(feature = "testing")]
105pub mod test_signing_backend;
106pub mod time_util;
107pub mod trailer;
108pub mod transaction;
109pub mod tree;
110pub mod tree_builder;
111pub mod ui_path;
112pub mod union_find;
113pub mod view;
114pub mod working_copy;
115pub mod workspace;
116pub mod workspace_store;
117
118#[cfg(test)]
119mod tests {
120    use tempfile::TempDir;
121
122    // Copied from `testutils::TestResult` to remove dependency cycle.
123    pub type TestResult<T = ()> = eyre::Result<T>;
124
125    /// Unlike `testutils::new_temp_dir()`, this function doesn't set up
126    /// hermetic Git environment.
127    pub fn new_temp_dir() -> TempDir {
128        tempfile::Builder::new()
129            .prefix("jj-test-")
130            .tempdir()
131            .unwrap()
132    }
133}