From 48fa821e6041f61fe72cb96a947c3e1b5241d5b4 Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Fri, 4 Aug 2023 17:59:19 -0500 Subject: [PATCH] cli: move src/ directory to new cli/ directory Summary: In preparation for unifying all workspace dependencies across all crates, let's go ahead and move the jj-cli crate into its own new directory. This will also be a nicer and more uniform layout as we add new `jj-*` crates. Signed-off-by: Austin Seipp Change-Id: Icf94e7ae5f290dc8e181215727b38ada --- Cargo.toml | 85 +------------------ cli/Cargo.toml | 81 ++++++++++++++++++ build.rs => cli/build.rs | 0 {src => cli/src}/cleanup_guard.rs | 0 {src => cli/src}/cli_util.rs | 0 {src => cli/src}/commands/bench.rs | 0 {src => cli/src}/commands/branch.rs | 0 {src => cli/src}/commands/debug.rs | 0 {src => cli/src}/commands/git.rs | 0 {src => cli/src}/commands/mod.rs | 0 {src => cli/src}/commands/operation.rs | 0 {src => cli/src}/commit_templater.rs | 0 {src => cli/src}/config-schema.json | 0 {src => cli/src}/config.rs | 0 {src => cli/src}/config/README.md | 0 {src => cli/src}/config/colors.toml | 0 {src => cli/src}/config/merge_tools.toml | 0 {src => cli/src}/config/misc.toml | 0 {src => cli/src}/config/templates.toml | 0 {src => cli/src}/diff_util.rs | 0 {src => cli/src}/formatter.rs | 0 {src => cli/src}/graphlog.rs | 0 {src => cli/src}/lib.rs | 0 {src => cli/src}/main.rs | 0 {src => cli/src}/merge_tools.rs | 0 {src => cli/src}/operation_templater.rs | 0 {src => cli/src}/progress.rs | 0 {src => cli/src}/template.pest | 0 {src => cli/src}/template_builder.rs | 0 {src => cli/src}/template_parser.rs | 0 {src => cli/src}/templater.rs | 0 {src => cli/src}/text_util.rs | 0 {src => cli/src}/time_util.rs | 0 {src => cli/src}/ui.rs | 0 .../testing}/bench-revsets-git.txt | 0 {testing => cli/testing}/fake-diff-editor.rs | 0 {testing => cli/testing}/fake-editor.rs | 0 37 files changed, 84 insertions(+), 82 deletions(-) create mode 100644 cli/Cargo.toml rename build.rs => cli/build.rs (100%) rename {src => cli/src}/cleanup_guard.rs (100%) rename {src => cli/src}/cli_util.rs (100%) rename {src => cli/src}/commands/bench.rs (100%) rename {src => cli/src}/commands/branch.rs (100%) rename {src => cli/src}/commands/debug.rs (100%) rename {src => cli/src}/commands/git.rs (100%) rename {src => cli/src}/commands/mod.rs (100%) rename {src => cli/src}/commands/operation.rs (100%) rename {src => cli/src}/commit_templater.rs (100%) rename {src => cli/src}/config-schema.json (100%) rename {src => cli/src}/config.rs (100%) rename {src => cli/src}/config/README.md (100%) rename {src => cli/src}/config/colors.toml (100%) rename {src => cli/src}/config/merge_tools.toml (100%) rename {src => cli/src}/config/misc.toml (100%) rename {src => cli/src}/config/templates.toml (100%) rename {src => cli/src}/diff_util.rs (100%) rename {src => cli/src}/formatter.rs (100%) rename {src => cli/src}/graphlog.rs (100%) rename {src => cli/src}/lib.rs (100%) rename {src => cli/src}/main.rs (100%) rename {src => cli/src}/merge_tools.rs (100%) rename {src => cli/src}/operation_templater.rs (100%) rename {src => cli/src}/progress.rs (100%) rename {src => cli/src}/template.pest (100%) rename {src => cli/src}/template_builder.rs (100%) rename {src => cli/src}/template_parser.rs (100%) rename {src => cli/src}/templater.rs (100%) rename {src => cli/src}/text_util.rs (100%) rename {src => cli/src}/time_util.rs (100%) rename {src => cli/src}/ui.rs (100%) rename {testing => cli/testing}/bench-revsets-git.txt (100%) rename {testing => cli/testing}/fake-diff-editor.rs (100%) rename {testing => cli/testing}/fake-editor.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index 419143fa6..01685b96e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,87 +1,8 @@ -[package] -name = "jj-cli" -version = "0.8.0" -authors = ["Martin von Zweigbergk "] -edition = "2021" -rust-version = "1.71" # Remember to update CI, and contributing.md -license = "Apache-2.0" -description = "Jujutsu (an experimental VCS)" -homepage = "https://github.com/martinvonz/jj" -repository = "https://github.com/martinvonz/jj" -documentation = "https://docs.rs/jj-cli" -readme = "README.md" -keywords = ["VCS", "DVCS", "SCM", "Git", "Mercurial"] -categories = ["command-line-utilities", "development-tools"] -default-run = "jj" - -[[bin]] -name = "jj" -path = "src/main.rs" - -[[bin]] -name = "fake-editor" -path = "testing/fake-editor.rs" - -[[bin]] -name = "fake-diff-editor" -path = "testing/fake-diff-editor.rs" +cargo-features = [] [workspace] -members = ["lib", "lib/testutils", "lib/gen-protos"] - -[build-dependencies] -cargo_metadata = "0.17.0" - -[dependencies] -chrono = { version = "0.4.26", default-features = false, features = ["std", "clock"] } -clap = { version = "4.3.19", features = ["derive", "deprecated"] } -clap_complete = "4.3.2" -clap_mangen = "0.2.10" -config = { version = "0.13.3", default-features = false, features = ["toml"] } -criterion = {version = "0.5.1", optional = true } -crossterm = { version = "0.26", default-features = false } -dirs = "5.0.1" -esl01-renderdag = "0.3.0" -git2 = "0.17.2" -glob = "0.3.1" -hex = "0.4.3" -indexmap = "2.0.0" -itertools = "0.11.0" -jj-lib = { version = "=0.8.0", path = "lib", default-features = false } -maplit = "1.0.2" -once_cell = "1.18.0" -pest = "2.7.2" -pest_derive = "2.7.2" -regex = "1.9.1" -rpassword = "7.2.0" -serde = { version = "1.0", features = ["derive"] } -slab = "0.4.8" -tempfile = "3.7.0" -textwrap = "0.16.0" -thiserror = "1.0.44" -timeago = { version = "0.4.1", default-features = false } -toml_edit = { version = "0.19.14", features = ["serde"] } -tracing = "0.1.37" -tracing-chrome = "0.7.1" -tracing-subscriber = { version = "0.3.17", default-features = false, features = ["std", "ansi", "env-filter", "fmt"] } - -[target.'cfg(unix)'.dependencies] -libc = { version = "0.2.147" } - -[dev-dependencies] -anyhow = "1.0.72" -assert_cmd = "2.0.8" -assert_matches = "1.5.0" -insta = { version = "1.31.0", features = ["filters"] } -test-case = "3.1.0" -testutils = { path = "lib/testutils" } - -[features] -default = [] -bench = ["criterion"] -packaging = ["watchman"] -vendored-openssl = ["git2/vendored-openssl", "jj-lib/vendored-openssl"] -watchman = ["jj-lib/watchman"] +resolver = "2" +members = ["cli", "lib", "lib/testutils", "lib/gen-protos"] [profile.release] strip = "debuginfo" diff --git a/cli/Cargo.toml b/cli/Cargo.toml new file mode 100644 index 000000000..af9d460b7 --- /dev/null +++ b/cli/Cargo.toml @@ -0,0 +1,81 @@ +[package] +name = "jj-cli" +version = "0.8.0" +authors = ["Martin von Zweigbergk "] +edition = "2021" +rust-version = "1.71" # Remember to update CI, and contributing.md +license = "Apache-2.0" +description = "Jujutsu (an experimental VCS)" +homepage = "https://github.com/martinvonz/jj" +repository = "https://github.com/martinvonz/jj" +documentation = "https://docs.rs/jj-cli" +readme = "README.md" +keywords = ["VCS", "DVCS", "SCM", "Git", "Mercurial"] +categories = ["command-line-utilities", "development-tools"] +default-run = "jj" + +[[bin]] +name = "jj" +path = "src/main.rs" + +[[bin]] +name = "fake-editor" +path = "testing/fake-editor.rs" + +[[bin]] +name = "fake-diff-editor" +path = "testing/fake-diff-editor.rs" + +[build-dependencies] +cargo_metadata = "0.17.0" + +[dependencies] +chrono = { version = "0.4.26", default-features = false, features = ["std", "clock"] } +clap = { version = "4.3.19", features = ["derive", "deprecated"] } +clap_complete = "4.3.2" +clap_mangen = "0.2.10" +config = { version = "0.13.3", default-features = false, features = ["toml"] } +criterion = {version = "0.5.1", optional = true } +crossterm = { version = "0.26", default-features = false } +dirs = "5.0.1" +esl01-renderdag = "0.3.0" +git2 = "0.17.2" +glob = "0.3.1" +hex = "0.4.3" +indexmap = "2.0.0" +itertools = "0.11.0" +jj-lib = { version = "=0.8.0", path = "../lib", default-features = false } +maplit = "1.0.2" +once_cell = "1.18.0" +pest = "2.7.2" +pest_derive = "2.7.2" +regex = "1.9.1" +rpassword = "7.2.0" +serde = { version = "1.0", features = ["derive"] } +slab = "0.4.8" +tempfile = "3.7.0" +textwrap = "0.16.0" +thiserror = "1.0.44" +timeago = { version = "0.4.1", default-features = false } +toml_edit = { version = "0.19.14", features = ["serde"] } +tracing = "0.1.37" +tracing-chrome = "0.7.1" +tracing-subscriber = { version = "0.3.17", default-features = false, features = ["std", "ansi", "env-filter", "fmt"] } + +[target.'cfg(unix)'.dependencies] +libc = { version = "0.2.147" } + +[dev-dependencies] +anyhow = "1.0.72" +assert_cmd = "2.0.8" +assert_matches = "1.5.0" +insta = { version = "1.31.0", features = ["filters"] } +test-case = "3.1.0" +testutils = { path = "../lib/testutils" } + +[features] +default = [] +bench = ["criterion"] +packaging = ["watchman"] +vendored-openssl = ["git2/vendored-openssl", "jj-lib/vendored-openssl"] +watchman = ["jj-lib/watchman"] diff --git a/build.rs b/cli/build.rs similarity index 100% rename from build.rs rename to cli/build.rs diff --git a/src/cleanup_guard.rs b/cli/src/cleanup_guard.rs similarity index 100% rename from src/cleanup_guard.rs rename to cli/src/cleanup_guard.rs diff --git a/src/cli_util.rs b/cli/src/cli_util.rs similarity index 100% rename from src/cli_util.rs rename to cli/src/cli_util.rs diff --git a/src/commands/bench.rs b/cli/src/commands/bench.rs similarity index 100% rename from src/commands/bench.rs rename to cli/src/commands/bench.rs diff --git a/src/commands/branch.rs b/cli/src/commands/branch.rs similarity index 100% rename from src/commands/branch.rs rename to cli/src/commands/branch.rs diff --git a/src/commands/debug.rs b/cli/src/commands/debug.rs similarity index 100% rename from src/commands/debug.rs rename to cli/src/commands/debug.rs diff --git a/src/commands/git.rs b/cli/src/commands/git.rs similarity index 100% rename from src/commands/git.rs rename to cli/src/commands/git.rs diff --git a/src/commands/mod.rs b/cli/src/commands/mod.rs similarity index 100% rename from src/commands/mod.rs rename to cli/src/commands/mod.rs diff --git a/src/commands/operation.rs b/cli/src/commands/operation.rs similarity index 100% rename from src/commands/operation.rs rename to cli/src/commands/operation.rs diff --git a/src/commit_templater.rs b/cli/src/commit_templater.rs similarity index 100% rename from src/commit_templater.rs rename to cli/src/commit_templater.rs diff --git a/src/config-schema.json b/cli/src/config-schema.json similarity index 100% rename from src/config-schema.json rename to cli/src/config-schema.json diff --git a/src/config.rs b/cli/src/config.rs similarity index 100% rename from src/config.rs rename to cli/src/config.rs diff --git a/src/config/README.md b/cli/src/config/README.md similarity index 100% rename from src/config/README.md rename to cli/src/config/README.md diff --git a/src/config/colors.toml b/cli/src/config/colors.toml similarity index 100% rename from src/config/colors.toml rename to cli/src/config/colors.toml diff --git a/src/config/merge_tools.toml b/cli/src/config/merge_tools.toml similarity index 100% rename from src/config/merge_tools.toml rename to cli/src/config/merge_tools.toml diff --git a/src/config/misc.toml b/cli/src/config/misc.toml similarity index 100% rename from src/config/misc.toml rename to cli/src/config/misc.toml diff --git a/src/config/templates.toml b/cli/src/config/templates.toml similarity index 100% rename from src/config/templates.toml rename to cli/src/config/templates.toml diff --git a/src/diff_util.rs b/cli/src/diff_util.rs similarity index 100% rename from src/diff_util.rs rename to cli/src/diff_util.rs diff --git a/src/formatter.rs b/cli/src/formatter.rs similarity index 100% rename from src/formatter.rs rename to cli/src/formatter.rs diff --git a/src/graphlog.rs b/cli/src/graphlog.rs similarity index 100% rename from src/graphlog.rs rename to cli/src/graphlog.rs diff --git a/src/lib.rs b/cli/src/lib.rs similarity index 100% rename from src/lib.rs rename to cli/src/lib.rs diff --git a/src/main.rs b/cli/src/main.rs similarity index 100% rename from src/main.rs rename to cli/src/main.rs diff --git a/src/merge_tools.rs b/cli/src/merge_tools.rs similarity index 100% rename from src/merge_tools.rs rename to cli/src/merge_tools.rs diff --git a/src/operation_templater.rs b/cli/src/operation_templater.rs similarity index 100% rename from src/operation_templater.rs rename to cli/src/operation_templater.rs diff --git a/src/progress.rs b/cli/src/progress.rs similarity index 100% rename from src/progress.rs rename to cli/src/progress.rs diff --git a/src/template.pest b/cli/src/template.pest similarity index 100% rename from src/template.pest rename to cli/src/template.pest diff --git a/src/template_builder.rs b/cli/src/template_builder.rs similarity index 100% rename from src/template_builder.rs rename to cli/src/template_builder.rs diff --git a/src/template_parser.rs b/cli/src/template_parser.rs similarity index 100% rename from src/template_parser.rs rename to cli/src/template_parser.rs diff --git a/src/templater.rs b/cli/src/templater.rs similarity index 100% rename from src/templater.rs rename to cli/src/templater.rs diff --git a/src/text_util.rs b/cli/src/text_util.rs similarity index 100% rename from src/text_util.rs rename to cli/src/text_util.rs diff --git a/src/time_util.rs b/cli/src/time_util.rs similarity index 100% rename from src/time_util.rs rename to cli/src/time_util.rs diff --git a/src/ui.rs b/cli/src/ui.rs similarity index 100% rename from src/ui.rs rename to cli/src/ui.rs diff --git a/testing/bench-revsets-git.txt b/cli/testing/bench-revsets-git.txt similarity index 100% rename from testing/bench-revsets-git.txt rename to cli/testing/bench-revsets-git.txt diff --git a/testing/fake-diff-editor.rs b/cli/testing/fake-diff-editor.rs similarity index 100% rename from testing/fake-diff-editor.rs rename to cli/testing/fake-diff-editor.rs diff --git a/testing/fake-editor.rs b/cli/testing/fake-editor.rs similarity index 100% rename from testing/fake-editor.rs rename to cli/testing/fake-editor.rs