Yuya Nishihara
a21397bfff
git: move remove/rename remote logic to library
...
These functions are somewhat similar to git::import/export_refs() in that
git_refs and branches are manipulated.
2023-07-09 10:08:07 +09:00
Yuya Nishihara
f3d6616057
view: add default formatting to RefName, use it to print unexported branches
2023-07-09 00:51:15 +09:00
Waleed Khan
f15c1d3c53
docs(fsmonitor): add filesystem monitor/Watchman documentation
2023-07-08 18:48:14 +03:00
Waleed Khan
cf1e1ddc2e
feat(fsmonitor): add watchman debug commands
2023-07-08 18:48:14 +03:00
Waleed Khan
9bb8e4fe2a
feat(fsmonitor): add .watchmanconfig
to repo
...
This identifies the directory as Watchman-enabled. Additional config settings can go in this file. The contents of this file are based on fb8ed41881/.watchmanconfig
.
2023-07-08 18:48:14 +03:00
Waleed Khan
ef83f2beeb
feat(fsmonitor): Watchman filesystem monitor implementation
2023-07-08 18:48:14 +03:00
Waleed Khan
d8705644b5
refactor(repo_path): accept AsRef<Path>
in RepoPath::parse_fs_path
...
Used in later commit.
2023-07-08 18:48:14 +03:00
Waleed Khan
de9cbace22
refactor(working_copy): create WorkItem struct
2023-07-08 18:48:14 +03:00
Waleed Khan
092dce0625
refactor(working_copy): create SnapshotOptions
struct
...
Required in a later commit.
2023-07-08 18:48:14 +03:00
Yuya Nishihara
85d87e2658
cli: warn if loosely selected push targets include conflicted branches
2023-07-08 10:23:21 +09:00
Yuya Nishihara
a3d080580e
cli: on git push, do not ignore conflicting branch at @
...
If @ is pointed by any branch, we shouldn't fall back to @-.
2023-07-08 10:23:21 +09:00
Yuya Nishihara
908520dcf5
cli: flatten nested loop that intersects branch targets and commit ids
2023-07-08 10:23:21 +09:00
Yuya Nishihara
78e8790e10
cli: inline branch_updates_for_push()
...
There are only two callers, and one of them knows that the branch exists.
2023-07-08 10:23:21 +09:00
Yuya Nishihara
d564c94548
cli: extract helper that maps BranchPushAction to BranchPushUpdate
...
We could add .as_update() -> Option<BranchPushUpdate>, but we'll probably
want to map a conflict message to warning.
2023-07-08 10:23:21 +09:00
Yuya Nishihara
7af45819b9
cli: split "git push --all"/"--deleted" handling
...
It's easier to follow than dispatching inside loop, and the match arms will
be deduplicated later.
2023-07-08 10:23:21 +09:00
Yuya Nishihara
16bf861e3b
tests: add "git push" tests involving conflicting branches
2023-07-08 10:23:21 +09:00
dependabot[bot]
22a84c8e97
cargo: bump the cargo-dependencies group with 2 updates
...
Bumps the cargo-dependencies group with 2 updates: [serde](https://github.com/serde-rs/serde ) and [thiserror](https://github.com/dtolnay/thiserror ).
Updates `serde` from 1.0.166 to 1.0.167
- [Release notes](https://github.com/serde-rs/serde/releases )
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.166...v1.0.167 )
Updates `thiserror` from 1.0.41 to 1.0.43
- [Release notes](https://github.com/dtolnay/thiserror/releases )
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.41...1.0.43 )
---
updated-dependencies:
- dependency-name: serde
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: cargo-dependencies
- dependency-name: thiserror
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: cargo-dependencies
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-07-07 17:52:36 +02:00
Martin von Zweigbergk
e28ce91d41
dependabot: also group cargo updates
...
It looks like I accidentally applied the grouping only to GitHub
actions updates.
2023-07-07 17:36:45 +02:00
Yuya Nishihara
43aca696c8
templater: inline RefTarget::has_add()
...
Since RefTarget::adds() now returns a slice, we don't need has_add() to bypass
temporary allocation of Vec<CommitId>.
2023-07-08 00:06:07 +09:00
Martin von Zweigbergk
eebc2ef5a1
commit_templater: avoid looking up tree only to get its id
2023-07-07 16:43:34 +02:00
Martin von Zweigbergk
7bcb01ae5e
conflicts: move repeated definition of c()
in tests to module level
...
Also remove an obsolete "Irreducible" in a comment.
2023-07-07 16:42:07 +02:00
Martin von Zweigbergk
2bc58ebacf
tree: avoid "file" in name of variables that can be non-files
2023-07-07 05:15:39 +02:00
Martin von Zweigbergk
76b1d53b1d
tree: avoid redoing a RepoPath::join()
...
I also renamed the variable from `file` to `path` to clarify.
2023-07-07 05:15:39 +02:00
Martin von Zweigbergk
7e48033a65
tree: remove dir
argument from TreeDiffIterator::new()
...
The argument is always the root directory.
2023-07-07 05:15:39 +02:00
Martin von Zweigbergk
1d8e9ec215
tree: inline two trivial functions
2023-07-07 05:15:39 +02:00
Martin von Zweigbergk
5da131f937
tree: add a Diff::from_options()
constructor
...
I'm not sure `Diff` is worth keeping, but as long as we have, it seems
that it should have this constructor.
2023-07-06 15:19:58 +02:00
Martin von Zweigbergk
b738f884c4
tree: drop Diff::as_options()
, use Diff::into_options()
instead
...
We don't have any current callers that only have a reference to a
`Diff`, so we don't need `.as_options()`.
2023-07-06 15:19:58 +02:00
Martin von Zweigbergk
8af22eb83c
working_copy: remove matching that's always against _
2023-07-06 14:24:38 +02:00
Yuya Nishihara
868188c84e
repo: handle empty .jj repo gracefully, include file path in error message
2023-07-06 20:48:46 +09:00
Yuya Nishihara
9560ca94c5
local_backend: remove global error conversion impls for BackendError
...
We don't care much about error handling in the local backend, but these
conversion impls are globally available and can be misused.
2023-07-06 20:48:46 +09:00
Yuya Nishihara
5346bd734f
git_backend: translate io::Error of read_conflict() to ReadObject error
...
This is the last place in Git backend where io::Error is magically converted
to BackendError::Other.
2023-07-06 20:48:46 +09:00
Yuya Nishihara
4e4ca46998
git_backend: wrap TableStoreError to preserve source error object
2023-07-06 20:48:46 +09:00
Yuya Nishihara
cf8a0466c4
backend: introduce error types specific to init/load phases
...
Errors that may occur while loading backend would vary per backends, and
it's unlikely that these errors could be mapped to BackendError variants
other than BackendError::Other. So let's extract Other(_) of that kind as
a separate type to clarify there would be no other error variants.
Perhaps, Backend/Error will be renamed to CommitBackend/Error or
CommitStore/Error?, whereas I think BackendInit/LoadError can be shared
among store factories.
2023-07-06 20:48:46 +09:00
Yuya Nishihara
e1e75daa8e
backend: make BackendError::Other preserve source error object
2023-07-06 20:48:46 +09:00
Martin von Zweigbergk
b3691e93fb
cli_util: don't clone arguments when resolving default command
2023-07-06 11:39:16 +02:00
Martin von Zweigbergk
1094109dfb
cli_util: avoid cloning args when resolving aliases
2023-07-06 11:39:16 +02:00
Martin von Zweigbergk
99226bb96d
tree: simplify diff iterator by leveraging Tree::value()
...
This is much simpler and I was slightly surprised that it doesn't have
much impact on performance. I tried `jj --ignore-working-copy diff -s
--from root --to v5.15` in the Linux kernel repo, and there was
perhaps a 1.5% slowdown (508 ms -> 515 ms). In more normal cases (like
diffing a single commit against its parent), I couldn't measure any
difference at all.
2023-07-06 11:21:21 +02:00
Martin von Zweigbergk
c93cbbee50
cli: remove author field from clap command
...
I'm not the only author, and it doesn't seem very useful to display
that information anyway (if it even appear anywhere).
2023-07-06 10:56:45 +02:00
Yuya Nishihara
5b78fe75b1
git_backend: propagate load() error to caller
...
#1794
2023-07-06 12:43:49 +09:00
Yuya Nishihara
84060d750b
git_backend: propagate init_internal() error to caller
2023-07-06 12:43:49 +09:00
Yuya Nishihara
2db4c906ad
git_backend: attach file path to initialization error
2023-07-06 12:43:49 +09:00
Yuya Nishihara
31bb68486e
git_backend: insert error type specific to backend initialization
...
This helps to map initialization error to BackendError without too general
From impl. I don't think io::Error (or our PathError) should be automatically
translated to BackendError::Other because BackendError has more specific
variants depending on context. If the error is specific to initialization,
it makes sense to translate it to Other variant.
2023-07-06 12:43:49 +09:00
Yuya Nishihara
a09a406817
git_backend: leverage std::fs::read/write() helpers
2023-07-06 12:43:49 +09:00
Yuya Nishihara
6d6b87f4b0
file_util: move PathError and its helper trait from repo module
...
It's generally useful in order to attach context to io::Error.
2023-07-06 12:43:49 +09:00
dependabot[bot]
cf81de0484
cargo: bump clap from 4.3.10 to 4.3.11
...
Bumps [clap](https://github.com/clap-rs/clap ) from 4.3.10 to 4.3.11.
- [Release notes](https://github.com/clap-rs/clap/releases )
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md )
- [Commits](https://github.com/clap-rs/clap/compare/v4.3.10...v4.3.11 )
---
updated-dependencies:
- dependency-name: clap
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-07-05 20:44:31 +00:00
dependabot[bot]
fc6a6f8e98
cargo: bump toml_edit from 0.19.11 to 0.19.12
...
Bumps [toml_edit](https://github.com/toml-rs/toml ) from 0.19.11 to 0.19.12.
- [Commits](https://github.com/toml-rs/toml/compare/v0.19.11...v0.19.12 )
---
updated-dependencies:
- dependency-name: toml_edit
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-07-05 22:32:08 +02:00
dependabot[bot]
a5f62787a8
cargo: bump clap_complete from 4.3.1 to 4.3.2
...
Bumps [clap_complete](https://github.com/clap-rs/clap ) from 4.3.1 to 4.3.2.
- [Release notes](https://github.com/clap-rs/clap/releases )
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md )
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.3.1...clap_complete-v4.3.2 )
---
updated-dependencies:
- dependency-name: clap_complete
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-07-05 22:30:10 +02:00
dependabot[bot]
a7408d8bc9
cargo: bump smallvec from 1.10.0 to 1.11.0
...
Bumps [smallvec](https://github.com/servo/rust-smallvec ) from 1.10.0 to 1.11.0.
- [Release notes](https://github.com/servo/rust-smallvec/releases )
- [Commits](https://github.com/servo/rust-smallvec/compare/v1.10.0...v1.11.0 )
---
updated-dependencies:
- dependency-name: smallvec
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-07-05 22:29:49 +02:00
Martin von Zweigbergk
fa25c3bd40
github: tell Dependabot to group all deps when possible
...
This should reduce the number of PRs to review, and the number of
uninteresting commits in the repo history.
2023-07-05 21:37:22 +02:00
Martin von Zweigbergk
a9bbe40bb7
cargo: remove regex
dev-dep duplicated from regular deps
2023-07-05 18:02:15 +02:00