Martin von Zweigbergk
6a15cc02bf
cli: print hints using "hint" style, not "error" style
...
Several lines of red text can be overwhelming, and makes it harder to
tell the hint from the error. Let's separate the hint from the error
instead. This matches what hg does. Having the hints separated out
also means that we could have a single config to turn them off.
2022-11-12 17:58:22 -08:00
Martin von Zweigbergk
2a17bb76e9
cli: add factory function for CommandError::UserError
...
I want to add a separate field for a hint, so that can be printed in a
different color (than red). Having a factory function is useful then,
since most call sites don't want to pass a hint. Also, by using a
factory function instead of using the constructor directly means that
we can accept `&str` arguments instead of forcing the caller to
convert a string literal to `String`.
2022-11-12 17:58:22 -08:00
Yuya Nishihara
eb790760a2
repo: simplify unsafe cast of view reference
2022-11-12 01:03:48 +09:00
Yuya Nishihara
2c042cee75
repo: extract unsafe view handling bits to separate struct
...
This should help us reason about the safety implication. New inner module
is added to encapsulate unsafe access.
DirtyCell provides .with_ref(callback) instead of .borrow(). This isn't
strictly needed, but should clarify the intent of the temporary reference.
This also allows us to rewrite DirtyCell without unsafe code, if needed,
by leveraging OnceCell<T> x RefCell<Option<T>> pair.
2022-11-12 01:03:48 +09:00
dependabot[bot]
3e77fcdafa
github: bump dtolnay/rust-toolchain
...
Bumps [dtolnay/rust-toolchain](https://github.com/dtolnay/rust-toolchain ) from ba37adf8f94a7d9affce79bd3baff1b9e3189c33 to 55c7845fad90d0ae8b2e83715cb900e5e861e8cb.
- [Release notes](https://github.com/dtolnay/rust-toolchain/releases )
- [Commits](ba37adf8f9...55c7845fad
)
---
updated-dependencies:
- dependency-name: dtolnay/rust-toolchain
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-11-11 07:30:54 -08:00
dependabot[bot]
5170b54ac7
cargo: bump blake2 from 0.10.4 to 0.10.5
...
Bumps [blake2](https://github.com/RustCrypto/hashes ) from 0.10.4 to 0.10.5.
- [Release notes](https://github.com/RustCrypto/hashes/releases )
- [Commits](https://github.com/RustCrypto/hashes/compare/blake2-v0.10.4...blake2-v0.10.5 )
---
updated-dependencies:
- dependency-name: blake2
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-11-11 21:50:49 +09:00
Martin von Zweigbergk
6c600e98cf
templater: indicate if branch needs to be pushed to a remote
...
It's useful to know when you've modified a branch that exists on a
remote. A typical case is when you have pushed a branch to a remote
and then rewritten it. This commit adds an indication in the
`branches` template keyword. A branch that needs to be pushed to a
remote now has a `*` at the end (similar to how conflicted branches
have a `?` at the end). Note that the indication only considers
remotes where the branch currently exists, so there won't be an
indication that the branch has not been pushed to a remote.
Closes #254
2022-11-09 22:44:55 -08:00
dependabot[bot]
5e710bac66
cargo: bump pest_derive from 2.4.0 to 2.4.1
...
Bumps [pest_derive](https://github.com/pest-parser/pest ) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/pest-parser/pest/releases )
- [Commits](https://github.com/pest-parser/pest/compare/v2.4.0...v2.4.1 )
---
updated-dependencies:
- dependency-name: pest_derive
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-11-09 08:45:54 -08:00
dependabot[bot]
c08dbd222e
cargo: bump assert_cmd from 2.0.5 to 2.0.6
...
Bumps [assert_cmd](https://github.com/assert-rs/assert_cmd ) from 2.0.5 to 2.0.6.
- [Release notes](https://github.com/assert-rs/assert_cmd/releases )
- [Changelog](https://github.com/assert-rs/assert_cmd/blob/master/CHANGELOG.md )
- [Commits](https://github.com/assert-rs/assert_cmd/compare/v2.0.5...v2.0.6 )
---
updated-dependencies:
- dependency-name: assert_cmd
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-11-08 08:22:00 -08:00
dependabot[bot]
375705c4d0
cargo: bump pest from 2.4.0 to 2.4.1
...
Bumps [pest](https://github.com/pest-parser/pest ) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/pest-parser/pest/releases )
- [Commits](https://github.com/pest-parser/pest/compare/v2.4.0...v2.4.1 )
---
updated-dependencies:
- dependency-name: pest
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-11-08 08:13:22 -08:00
dependabot[bot]
78418389b2
cargo: bump num_cpus from 1.13.1 to 1.14.0
...
Bumps [num_cpus](https://github.com/seanmonstar/num_cpus ) from 1.13.1 to 1.14.0.
- [Release notes](https://github.com/seanmonstar/num_cpus/releases )
- [Changelog](https://github.com/seanmonstar/num_cpus/blob/master/CHANGELOG.md )
- [Commits](https://github.com/seanmonstar/num_cpus/compare/v1.13.1...v1.14.0 )
---
updated-dependencies:
- dependency-name: num_cpus
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-11-08 08:11:38 -08:00
dependabot[bot]
9a4c4542bd
cargo: bump predicates from 2.1.1 to 2.1.2
...
Bumps [predicates](https://github.com/assert-rs/predicates-rs ) from 2.1.1 to 2.1.2.
- [Release notes](https://github.com/assert-rs/predicates-rs/releases )
- [Changelog](https://github.com/assert-rs/predicates-rs/blob/master/CHANGELOG.md )
- [Commits](https://github.com/assert-rs/predicates-rs/compare/v2.1.1...v2.1.2 )
---
updated-dependencies:
- dependency-name: predicates
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-11-08 08:06:35 -08:00
dependabot[bot]
3958363777
cargo: bump clap from 4.0.18 to 4.0.22
...
Bumps [clap](https://github.com/clap-rs/clap ) from 4.0.18 to 4.0.22.
- [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.0.18...v4.0.22 )
---
updated-dependencies:
- dependency-name: clap
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-11-08 07:59:44 -08:00
dependabot[bot]
5b5ab1fb3e
cargo: bump regex from 1.6.0 to 1.7.0
...
Bumps [regex](https://github.com/rust-lang/regex ) from 1.6.0 to 1.7.0.
- [Release notes](https://github.com/rust-lang/regex/releases )
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md )
- [Commits](https://github.com/rust-lang/regex/compare/1.6.0...1.7.0 )
---
updated-dependencies:
- dependency-name: regex
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-11-08 07:44:24 -08:00
dependabot[bot]
e326015c2a
cargo: bump clap_complete from 4.0.3 to 4.0.5
...
Bumps [clap_complete](https://github.com/clap-rs/clap ) from 4.0.3 to 4.0.5.
- [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.0.3...clap_complete-v4.0.5 )
---
updated-dependencies:
- dependency-name: clap_complete
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-11-08 07:41:05 -08:00
dependabot[bot]
571952dac6
github: bump github/codeql-action from 2.1.30 to 2.1.31
...
Bumps [github/codeql-action](https://github.com/github/codeql-action ) from 2.1.30 to 2.1.31.
- [Release notes](https://github.com/github/codeql-action/releases )
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md )
- [Commits](18fe527fa8...c3b6fce4ee
)
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-11-08 07:40:08 -08:00
Martin von Zweigbergk
3c7c4e9f5c
tests: move testutils
module into separate crate
...
The `testutils` module should ideally not be part of the library
dependencies. Since they're used by the integration tests (and the CLI
tests), we need to move them to a separate crate to achieve that.
2022-11-08 07:29:35 -08:00
Martin von Zweigbergk
924926a100
changelog: fix typo ("specity")
2022-11-07 13:48:48 -08:00
Yuya Nishihara
fa3ad16bf2
revset: add present(set) predicate that suppresses NoSuchRevision error
...
This is copied from Mercurial. Typical use case I have in mind is
"present(master) | present(main)" in stock revset.
2022-11-07 21:41:54 +09:00
Yuya Nishihara
ed14292aa2
revset: add EagerRevset::empty() constructor for convenience
2022-11-07 21:41:54 +09:00
Benjamin Saunders
46fe0791e8
cli: fix rebase error
2022-11-06 18:50:58 -08:00
Benjamin Saunders
210b54afd7
cli: hide cursor during progress display
2022-11-06 18:15:22 -08:00
Benjamin Saunders
472b6926e5
cli: define drop+signal guard helper
2022-11-06 18:15:22 -08:00
Benjamin Saunders
135e4d64dd
cli: clean up progress error handling
2022-11-06 17:31:29 -08:00
Benjamin Saunders
d69eb808df
git: prompt for credentials when needed
2022-11-06 17:31:29 -08:00
Benjamin Saunders
fd0a065801
cli: remove lifetime from Progress
2022-11-06 17:31:29 -08:00
Benjamin Saunders
a23cc8eb5a
cli: factor out RemoteCallbacks setup
2022-11-06 17:31:29 -08:00
Benjamin Saunders
88a4f83cf8
git: factor ssh key lookup out of lib
2022-11-06 17:31:29 -08:00
Benjamin Saunders
b55c4ae0a3
git: move progress callback into a struct
2022-11-06 17:31:29 -08:00
Martin von Zweigbergk
a27da7d8d5
repo: remove last mutating method from ReadonlyRepo
...
`ReadonlyRepo::reindex()` is only used in `jj debug reindex`, and it
can be implemented by creating a new instance instead of mutating
`ReadonlyRepo`.
2022-11-06 16:43:54 -08:00
Ilya Grigoriev
cf3b6ee2c9
Include file list when editing split commit description
...
Example:
JJ: Enter commit description for the first part (parent).
Better split commit message
JJ: This part contains the following changes:
JJ: M src/formatter.rs
JJ:
JJ: Lines starting with "JJ: " (like this one) will be removed.
2022-11-06 13:51:28 -08:00
Martin von Zweigbergk
a86de96bd4
cli: replace "current checkout" by "working-copy commit"
2022-11-05 22:56:14 -07:00
Martin von Zweigbergk
1d97f39da1
cleanup: avoid an unnecessary Box
for argument to formatter
...
I think this cleanup was enabled by a recent refactoring that replaced
a trait object by a type parameter (3392e83486
).
2022-11-05 22:49:54 -07:00
Yuya Nishihara
2681e8f908
repo: use OnceCell instead of Mutex<Option<_>> to store index
...
This is perfect use case of OnceCell per the safety comment in index().
2022-11-06 13:54:25 +09:00
Ilya Grigoriev
93b7b34871
Add --config-toml command-line argument for additional TOML config
...
Unfortunately, TOML requires quotes around the argument. So, the
usage is `jj --config-toml ui.color=\"always\"` in bash. The plan is
to eventually have a `--config` option with simpler syntax for
simple cases.
As discussed in https://github.com/martinvonz/jj/discussions/688 .
2022-11-05 21:21:33 -07:00
Yuya Nishihara
5d42c9ebca
cli: handle init destination error gracefully
2022-11-05 22:50:29 +09:00
Martin von Zweigbergk
61468ed126
commit_builder: remove redundant for_open_commit()
...
The function is now the same as `for_new_commit()`, except that it
accepts only one parent.
2022-11-05 06:14:37 -07:00
Martin von Zweigbergk
6703810c6e
backend: remove Commit::is_open
field from data model
2022-11-05 06:14:37 -07:00
Martin von Zweigbergk
91ee32b183
templater: drop support for open
template keyword
2022-11-05 06:14:37 -07:00
Martin von Zweigbergk
6320f24360
cli: remove open
/close
commands
2022-11-05 06:14:37 -07:00
Martin von Zweigbergk
a6dd84dc5c
tests: avoid about-to-be-deleted open
template keyword
2022-11-05 06:14:37 -07:00
Martin von Zweigbergk
5a4c463dc0
tests: avoid about-to-be-deleted close
command
2022-11-05 06:14:37 -07:00
Martin von Zweigbergk
21cda3431c
cli: drop support for ui.enable-open-commits
config
2022-11-05 06:14:37 -07:00
Martin von Zweigbergk
f02d92a3fe
cli: add commit
as its own command (not an alias for close
)
...
It seems very likely that we're going to remove support for open
commits, but it's still useful to have a `commit` command that lets
the user enter a description and starts a new change. Calling it
`commit` seems good to make the transition from other VCSs simpler.
2022-11-05 06:14:37 -07:00
Martin von Zweigbergk
ea576a8327
test_git_colocated: remove an unnecessary git import
...
The whole file is about the colocated case, where we automatically
import and export on every command, so there should be no reason to
call `git import` here.
2022-11-05 06:14:37 -07:00
Martin von Zweigbergk
1bab9db28e
test_rebase_command: avoid unnecessary close
command
...
Closing the working-copy commit doesn't seem to add anything to the
tests.
2022-11-05 06:14:37 -07:00
Martin von Zweigbergk
4399ef54c1
test_rebase_command: avoid an unnecessary special case
...
`jj new` can be used with 1 or more arguments to create non-merge
commits or merge commits.
2022-11-05 06:14:37 -07:00
Martin von Zweigbergk
d09a8f50df
tests: delete obsolete smoke test
...
The smoke test was useful a year ago, when our CLI test environment
was still annoying enough to use that there were very few tests. We
now have enough tests that the smoke test is not needed.
2022-11-05 06:14:37 -07:00
Martin von Zweigbergk
c8c4497ea0
docs: describe the conflict-resolution workflow without open commits
2022-11-05 06:14:37 -07:00
Martin von Zweigbergk
6dd91cf1c1
test_mut_repo: also run tests with Git backend
...
I haven't tried to figure out when it happened, but these tests seem
to consistently pass now.
2022-11-05 06:14:37 -07:00