dependabot[bot]
45e2f38bba
cargo: bump serde_json from 1.0.85 to 1.0.86
...
Bumps [serde_json](https://github.com/serde-rs/json ) from 1.0.85 to 1.0.86.
- [Release notes](https://github.com/serde-rs/json/releases )
- [Commits](https://github.com/serde-rs/json/compare/v1.0.85...v1.0.86 )
---
updated-dependencies:
- dependency-name: serde_json
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-10-10 10:56:04 -07:00
dependabot[bot]
7784be4200
cargo: bump uuid from 1.1.2 to 1.2.1
...
Bumps [uuid](https://github.com/uuid-rs/uuid ) from 1.1.2 to 1.2.1.
- [Release notes](https://github.com/uuid-rs/uuid/releases )
- [Commits](https://github.com/uuid-rs/uuid/compare/1.1.2...1.2.1 )
---
updated-dependencies:
- dependency-name: uuid
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-10-10 10:55:45 -07:00
Martin von Zweigbergk
5fa21b612c
cli: remind the user to configure their name and email
...
This commit adds a reminder in `finish_transaction()` if the user
hasn't configured their name and email. That means they'll get a
reminder after most mutating commits, except for commands that only
snapshot the working copy, and a few more cases.
Closes #530 .
2022-10-09 21:24:05 -07:00
Martin von Zweigbergk
f356578b5b
cli: clarify that the "first" commit created by split
is the parent
...
This came up in discussion #620 .
2022-10-09 19:56:38 -07:00
Martin von Zweigbergk
6526b76ef0
cleanup: move default()
functions to impl Default
...
As suggested by a newer version of Clippy.
2022-10-09 12:20:15 -07:00
Martin von Zweigbergk
e11540162a
graphlog: use usize::from(:bool)
to convert boolean to integer
...
As suggested by a newer Clippy version.
2022-10-09 12:20:15 -07:00
Martin von Zweigbergk
d8c8283782
revset: wrap pest error in a Box
, to keep type small
...
A newer version of Clippy starts complianing that the type is too
large (>=184 bytes) otherwise.
2022-10-09 12:20:15 -07:00
Martin von Zweigbergk
af4d183c7e
cleanup: automated fixes by new Clippy version
2022-10-09 12:20:15 -07:00
Martin von Zweigbergk
043d118f1f
cli: disallow initializing repo with native backend by default
...
The native backend is just a proof of concept and there's no real
reason to use it other than for testing, so let's reduce the risk of
accidentally creating repos using it.
2022-10-09 01:00:03 -07:00
Yuya Nishihara
832457d4a5
cli: fix --color=auto to not test isatty() unless initialized for terminal
...
No behavior change since ui here is always initialized for_terminal().
2022-10-09 09:08:46 +09:00
Yuya Nishihara
6a126bc033
cli: leverage Stdout/errLock in place of Mutex<Box<dyn Write>>
...
Since stdout/stderr has its own locking mechanism, we don't need yet
another Mutex.
2022-10-09 09:08:46 +09:00
Yuya Nishihara
536cab4cd7
cli: bypass stdout_formatter() for simple write calls
2022-10-09 09:08:46 +09:00
Yuya Nishihara
cb53ccbe5c
cli: store bare output streams in ui, create formatter per request
...
This allows us to reconfigure the formatter without reinitializing the
underlying streams.
2022-10-09 09:08:46 +09:00
Yuya Nishihara
7e83b30d8e
cli: remove useless Box wrapper from buffered formatter
2022-10-09 09:08:46 +09:00
Yuya Nishihara
3392e83486
cli: do not abstract away underlying output stream at formatter layer
...
Since the concrete Formatter type is hidden behind the Ui, there wouldn't
be many reasons to use dyn Write at the formatter layer. This allows us
to create a formatter against MutexGuard<Box<dyn Write>> without one more
Box<dyn Write> wrapper.
2022-10-09 09:08:46 +09:00
Yuya Nishihara
885f1d04d1
cli: introduce FormatterFactory to cache color table
...
This should help to create a temporary ColorFormatter instantly.
A cached_colors table could also be shared across formatters, but doing that
would require some locking mechanism. Since commands like cmd_log/diff()
use a single formatter instance, I don't think shared mutable cache would be
needed for the moment.
2022-10-09 09:08:46 +09:00
dependabot[bot]
c1d5a90156
github: bump github/codeql-action from 2.1.26 to 2.1.27
...
Bumps [github/codeql-action](https://github.com/github/codeql-action ) from 2.1.26 to 2.1.27.
- [Release notes](https://github.com/github/codeql-action/releases )
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md )
- [Commits](e0e5ded33c...807578363a
)
---
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-10-07 09:30:19 -07:00
Yuya Nishihara
56191610c7
cli: pass formatter label by reference
...
All callers do String::from(), .to_string(), or .clone(), but owned label
isn't needed unless formatter is a ColorFormatter.
2022-10-08 00:52:33 +09:00
Yuya Nishihara
a1a93682cb
cli: keep and reuse formatter instance at call site
2022-10-08 00:52:33 +09:00
Yuya Nishihara
97f37526e7
cli: extract write_commit_summary() as utility function
...
This allows callers to instantiate long-lived formatter. ui.write() can't
be invoked while formatter is borrowed. My plan is to make Ui directly hold
output streams so the color settings can be easily reset.
ui.stdout/stderr_formatter() will create a temporary formatter there.
write_commit_summary() could be hosted by WorkspaceCommandHelper to eliminate
some of the function arguments, but that would make the source RepoRef unclear
while transaction is in progress.
2022-10-08 00:52:33 +09:00
dependabot[bot]
f250a52a72
cargo: bump clap from 4.0.9 to 4.0.10
...
Bumps [clap](https://github.com/clap-rs/clap ) from 4.0.9 to 4.0.10.
- [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.9...v4.0.10 )
---
updated-dependencies:
- dependency-name: clap
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-10-06 09:19:03 -07:00
Yuya Nishihara
45c4734b52
revset: fix parsing of concatenated-identifier in expression
...
Previously an expression 'foo-bar-' failed to parse because
1. try first rule: 'foo-bar-' matches (identifier_part+ ~ '-')+, but the
trailing '' doesn't match identifier_part+
2. fall back to second rule: 'foo' matches identifier_part+
=> (identifier 'foo')
Instead, we need to consume as much (identifier_part ~ '-' ~ ...) as possible
before falling back to the identifier_part rule.
I think the trailing + of identifier_part+ is redundant, so removed it as
well.
2022-10-06 21:56:41 +09:00
Martin von Zweigbergk
18c0b97d9d
cli: remove jj bench
commands
...
I haven't used these in a long time. Not including it reduces the
binary size from 16.8 MB to 15.1 MiB.
2022-10-05 22:12:12 -07:00
Martin von Zweigbergk
43f0cddb1c
cargo: enable only config
crate's toml
feature
...
I had intended for the `features = ["toml"]` to enable *only* the
`toml` feature, but I forgot to disable the default features so it had
no effect. This shrinks the binary from 17.4 MiB to 16.8 MiB.
2022-10-05 22:12:12 -07:00
dependabot[bot]
0cfa6f435a
cargo: bump clap from 4.0.8 to 4.0.9
...
Bumps [clap](https://github.com/clap-rs/clap ) from 4.0.8 to 4.0.9.
- [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.8...v4.0.9 )
---
updated-dependencies:
- dependency-name: clap
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-10-04 22:49:57 -07:00
dependabot[bot]
1e35a5eeee
cargo: bump pest_derive from 2.3.1 to 2.4.0
...
Bumps [pest_derive](https://github.com/pest-parser/pest ) from 2.3.1 to 2.4.0.
- [Release notes](https://github.com/pest-parser/pest/releases )
- [Commits](https://github.com/pest-parser/pest/compare/v2.3.1...v2.4.0 )
---
updated-dependencies:
- dependency-name: pest_derive
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-10-04 22:49:29 -07:00
dependabot[bot]
02ccbaa86e
github: bump actions/checkout from 3.0.2 to 3.1.0
...
Bumps [actions/checkout](https://github.com/actions/checkout ) from 3.0.2 to 3.1.0.
- [Release notes](https://github.com/actions/checkout/releases )
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md )
- [Commits](2541b1294d...93ea575cb5
)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-10-04 22:49:04 -07:00
Yuya Nishihara
f5d0419384
working_copy: return {operation_id, workspace_id} by reference
...
Let WorkspaceCommandHelper clone it. WorkspaceCommandHelper could return
workspace_id by reference, but doing that would introduce noisy .clone()
calls and lifetime mess.
2022-10-03 21:41:20 -07:00
Yuya Nishihara
c0c1eade91
working_copy: use OnceCell to manage {operation_id, workspace_id}
...
For consistency with the tree_state handling. This isn't that simple and
concise compared to the tree_state one, so I'm fine to drop the series.
I've extracted {operation_id, workspace_id} pair so these values can be
safely initialized by OnceCell. The extracted struct is named after the
"checkout" file.
2022-10-03 21:41:20 -07:00
Yuya Nishihara
a2f750171a
working_copy: remove redundant reload of checkout state on discard()
...
There's no way to mutate operation_id other than finish().
2022-10-03 21:41:20 -07:00
dependabot[bot]
b5e628ab07
cargo: bump pest from 2.3.1 to 2.4.0
...
Bumps [pest](https://github.com/pest-parser/pest ) from 2.3.1 to 2.4.0.
- [Release notes](https://github.com/pest-parser/pest/releases )
- [Commits](https://github.com/pest-parser/pest/compare/v2.3.1...v2.4.0 )
---
updated-dependencies:
- dependency-name: pest
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-10-03 08:56:24 -07:00
dependabot[bot]
c352deaa59
cargo: bump clap from 4.0.6 to 4.0.8
...
Bumps [clap](https://github.com/clap-rs/clap ) from 4.0.6 to 4.0.8.
- [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.6...v4.0.8 )
---
updated-dependencies:
- dependency-name: clap
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-10-03 08:51:38 -07:00
dependabot[bot]
53fc4a179c
cargo: bump test-case from 2.2.1 to 2.2.2
...
Bumps [test-case](https://github.com/frondeus/test-case ) from 2.2.1 to 2.2.2.
- [Release notes](https://github.com/frondeus/test-case/releases )
- [Changelog](https://github.com/frondeus/test-case/blob/master/CHANGELOG.md )
- [Commits](https://github.com/frondeus/test-case/compare/v2.2.1...v2.2.2 )
---
updated-dependencies:
- dependency-name: test-case
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-10-03 08:50:48 -07:00
Martin von Zweigbergk
0c8c33df73
readme: update asciinema links
...
As @huyz noticed, I accidentally lost the undo demo in 0d1bf7cb3b
. I
also didn't update the working-copy demo. This patch fixes that by
updating all demos, so we also get the recent styling change from
af145c998ea4..
2022-10-02 21:55:26 -07:00
Yuya Nishihara
1800354465
working_copy: remove .clone() from TreeState proxy methods
...
Let the caller .clone() as needed.
2022-10-02 22:46:09 +09:00
Yuya Nishihara
786e6211d8
working_copy: use OnceCell for lazy instantiation of TreeState
...
Here OnceCell<T> serves as RefCell<Option<T>>, but it doesn't require runtime
Ref/RefMut wrapper. This allows us to get rid of some .clone() calls needed to
hide Ref<_> from public interface.
2022-10-02 22:46:09 +09:00
Yuya Nishihara
4f72ec142d
cargo: bump once_cell, add explicit dependency
2022-10-02 22:46:09 +09:00
Tal Pressman
621caa4dcb
add default log revset configuration setting
2022-10-02 16:56:18 +09:00
Yuya Nishihara
7faa3c8e81
cli: always call locked_wc.finish() after snapshotting working copy
...
Otherwise mtime information could be lost, and snapshot() would always
need to build a tree object for comparison.
Closes #554
2022-10-02 15:15:18 +09:00
Yuya Nishihara
dc9a9ed4c1
working_copy: on finish(), don't serialize checkout if operation_id is unchanged
...
Maybe it's okay to always save the checkout state, but let's apply the same
rule as the previous commit.
2022-10-02 15:15:18 +09:00
Yuya Nishihara
a8a3a236b0
working_copy: on finish(), don't serialize tree_state if known to be clean
...
This allows us to call locked_wc.finish() no matter if the tree is changed
or not.
2022-10-02 15:15:18 +09:00
Yuya Nishihara
e716fe7abf
working_copy: remove return value from TreeState::snapshot()
...
I'll make TreeState::snapshot() return a boolean denoting whether tree_state
is updated or not. New tree_id can be obtained from TreeState, so let's
remove it from the return value.
2022-10-02 15:15:18 +09:00
Yuya Nishihara
9c33062d11
working_copy: clarify tree_state shouldn't be modified without mutable ref
...
While making tree_state() return RefMut<TreeState> instead of RefMut<Option<_>>,
I felt uncomfortable that tree_state(&self) returned a mutable reference. So
this patch splits it into tree_state() and tree_state_mut().
2022-10-02 15:15:18 +09:00
dependabot[bot]
750878a3fd
github: bump github/codeql-action from 2.1.25 to 2.1.26
...
Bumps [github/codeql-action](https://github.com/github/codeql-action ) from 2.1.25 to 2.1.26.
- [Release notes](https://github.com/github/codeql-action/releases )
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md )
- [Commits](86f3159a69...e0e5ded33c
)
---
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-09-30 09:09:30 -07:00
dependabot[bot]
7e74a3b035
cargo: bump clap_mangen from 0.2.1 to 0.2.2
...
Bumps [clap_mangen](https://github.com/clap-rs/clap ) from 0.2.1 to 0.2.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_mangen-v0.2.1...clap_mangen-v0.2.2 )
---
updated-dependencies:
- dependency-name: clap_mangen
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-09-30 09:08:57 -07:00
dependabot[bot]
1d4cb3399b
cargo: bump clap from 4.0.4 to 4.0.6
...
Bumps [clap](https://github.com/clap-rs/clap ) from 4.0.4 to 4.0.6.
- [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.4...v4.0.6 )
---
updated-dependencies:
- dependency-name: clap
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-09-30 09:08:29 -07:00
Martin von Zweigbergk
3b3f6129e6
backend: allow negative timestamps in commits and operations
...
I was reading a draft of "Git Rev News: Edition 91" [1] where Peff
mentions some unfinished patches to allow negative timestamps in
Git. So I figured I should add support for that before I forget. I
haven't checked if libgit2 supports it, so it might be that our Git
backend still doesn't support it after this patch.
[1] https://github.com/git/git.github.io/blob/master/rev_news/drafts/edition-91.md
2022-09-30 00:50:17 -07:00
Martin von Zweigbergk
3fc7b549ec
cleanup: rename some more variables from checkout_*
to ~wc_
2022-09-29 23:51:34 -07:00
Georges Dubus
5b5a85fe33
Change pkgconfig
to pkg-config
...
`pkgconfig` has been a alias to `pkg-config` since 2021-01-18, and has started being an error since 2022-09-24.
This commit makes recent nixpkgs versions work, but might make version older than January 2021 break (which is probably not an issue).
2022-09-29 17:56:06 -07:00
Martin von Zweigbergk
89680b8df9
cli: update off of deprecated clap API
2022-09-29 17:53:36 -07:00