ok/jj
1
0
Fork 0
forked from mirrors/jj
Commit graph

6918 commits

Author SHA1 Message Date
Martin von Zweigbergk
10aab1bdc3 conflicts: always promote legacy trees to merged trees
In order to remove the `MergedTree::Legacy` form, we need to stop
creating such instances. This patch removes the last place we create
them, which is in `Store::get_root_tree()`.

The main practical consequence of this change is that loading legacy
trees gets a lot slower on large repos. However, since the default log
template includes the `conflict` keyword, we ended up scanning all
paths in `jj log` anyway, so I'm not sure many people will notice.
2024-08-08 05:32:16 -07:00
Yuya Nishihara
202fb533f4 merged_tree: remove .diff() method in favor of .diff_stream()
It's unlikely we'll need the iterator version of .diff() except for testing
the stream implementation.
2024-08-08 10:45:59 +09:00
Yuya Nishihara
24b8934b14 tests: migrate .diff() callers to .diff_stream() 2024-08-08 10:45:59 +09:00
Yuya Nishihara
63e254d052 tests: use pollster instead of futures::executor::block_on()
It doesn't matter in tests and I have no preference over these, but we tend
to use .block_on().
2024-08-08 10:45:59 +09:00
Yuya Nishihara
26f744ab2d revset: use .diff_stream() in file() evaluation, handle backend error
This is the last .diff() caller in non-test code. Though it wouldn't be
important to use async version here, this change helps remove .diff() API.
2024-08-08 10:45:59 +09:00
Martin von Zweigbergk
27d8198fa1 release: release version 0.20.0
Thanks to everyone who's contributed!
2024-08-07 10:20:21 -07:00
dependabot[bot]
ed221d3327 github: bump github/codeql-action in the github-dependencies group
Bumps the github-dependencies group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.25.15 to 3.26.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](afb54ba388...eb055d739a)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-07 18:05:52 +02:00
dependabot[bot]
51b4993c18 cargo: bump tempfile in the cargo-dependencies group
Bumps the cargo-dependencies group with 1 update: [tempfile](https://github.com/Stebalien/tempfile).


Updates `tempfile` from 3.11.0 to 3.12.0
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/commits)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-07 18:05:40 +02:00
Yuya Nishihara
b3ede64472 cargo: bump gix to 0.64.0
config.<type>_by_key() is merged with config.<type>().
2024-08-07 20:32:58 +09:00
Yuya Nishihara
7bdb28f1fe cli: make "op abandon" not fail with multiple op heads
Since "op abandon" just rewrites DAG, it works no matter if the heads are
merged or not. This change will help crash recovery. "op abandon
--at-op=<one-of-the-heads>" can't be used because ancestor operations would be
preserved by the other head.
2024-08-07 10:51:44 +09:00
Yuya Nishihara
399110b1fc op_walk: allow to resolve operation expression from multiple heads
I'll make "op abandon" work without merging op heads.
2024-08-07 10:51:44 +09:00
Yuya Nishihara
4e3a5de6e9 op_walk: sort current heads to stabilize multiple ops error message 2024-08-07 10:51:44 +09:00
Yuya Nishihara
8cac8fba5a cli: op diff: consolidate match arms of forward diffs
These two are equivalent. It's still restricted to zero or one removed commits
because I'm not sure how diverged changes should be rendered.
2024-08-07 10:51:23 +09:00
Yuya Nishihara
f7836aa687 cli: obslog: show diffs from all predecessors, not first predecessor
Suppose a squash node in obslog is analogous to a merge in revisions log, it
makes sense to show diffs from auto-merge (or auto-squash) parents. This
basically means a non-partial squash node no longer shows diffs.

This also fixes missing diffs at the root predecessors if there were.
2024-08-07 10:51:23 +09:00
Yuya Nishihara
83ee6489d9 tests: add partial/multi-source squashes to obslog test 2024-08-07 10:51:23 +09:00
Yuya Nishihara
c99f502c31 tests: leverage "squash -m" in obslog test 2024-08-07 10:51:23 +09:00
Yuya Nishihara
92ba6d336d cli: op diff: be more strict about multiple diff sources/destinations
As the doc comment states, this function only supports change of "a single
added and removed commit", "only a single added", or "single removed commit."
It doesn't make sense to show diffs from the parent commit ignoring multiple
removed commits for example.
2024-08-07 10:51:23 +09:00
Ilya Grigoriev
b42e94906d jj run: describe it as a stub in the help text 2024-08-06 17:51:01 -07:00
Ilya Grigoriev
132dfd30e2 describe: warn user of limitations when describing multiple commits
I think it might be nice to have this in the upcoming release, but I'd
like to warn people that their changes will be lost if they aren't
careful, and to not rely on the syntax being fixed just yet.
2024-08-06 11:28:21 -07:00
Ilya Grigoriev
6d1cc7f803 describe multiple commits: instruct user where to put commit descriptions
This seems especially helpful if the descriptions start out empty.
2024-08-06 11:28:21 -07:00
dependabot[bot]
07e9339c6a github: bump actions/upload-artifact in the github-dependencies group
Bumps the github-dependencies group with 1 update: [actions/upload-artifact](https://github.com/actions/upload-artifact).


Updates `actions/upload-artifact` from 4.3.5 to 4.3.6
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](89ef406dd8...834a144ee9)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-06 11:27:57 -07:00
Ilya Grigoriev
b2123282e8 tutorial: link to Steve Klabnik's tutorial, mention jj log -r ::
I was thinking of updating the tutorial in #4168, but conversations like [this
one on
Discord](https://discord.com/channels/968932220549103686/968932220549103689/1269803837070377076)
suggest that many people aren't reading it anyway.

So, this is an attempt to quickly patch up the most relevant things before the
upcoming release.
2024-08-06 11:27:08 -07:00
dependabot[bot]
6fc0c7bdce github: bump the github-dependencies group across 1 directory with 2 updates
Bumps the github-dependencies group with 2 updates in the / directory: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [EmbarkStudios/cargo-deny-action](https://github.com/embarkstudios/cargo-deny-action).


Updates `actions/upload-artifact` from 4.3.4 to 4.3.5
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](0b2256b8c0...89ef406dd8)

Updates `EmbarkStudios/cargo-deny-action` from 1.6.3 to 2.0.1
- [Release notes](https://github.com/embarkstudios/cargo-deny-action/releases)
- [Commits](3f4a782664...8371184bd1)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
- dependency-name: EmbarkStudios/cargo-deny-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-05 23:12:24 -07:00
Ilya Grigoriev
dd67e4921d github actions: upgrade cargo-deny-action
Stolen from Dependabot's https://github.com/martinvonz/jj/pull/4200/
2024-08-05 22:46:31 -07:00
Ilya Grigoriev
1dc0c7698d cargo-deny: add MPL-2.0 to allowed licenses
For some reason, the current version of `cargo-deny-action` does not
require it, but the one in the next commit fails if the license is
not added.
2024-08-05 22:46:31 -07:00
Ilya Grigoriev
6e7a20edd7 cargo-deny: use the new default for deny.toml
This is needed because old keys are becoming unsupported in the next
version of the `cargo-deny` action.

This was obtained as follows:
- Run `cargo deny init`
- Modify (only) the `licenses.allow` field to match what we had before.
2024-08-05 22:46:31 -07:00
Martin von Zweigbergk
417f19d58a docs: minor updates to description of branch conflicts
Closes #4220.
2024-08-05 18:20:37 -07:00
Yuya Nishihara
d061c3782f merged_tree: remove .diff_summary()
There are no non-test callers since 452fecb7c4 "cli: colorize diff summary
and sort by path."
2024-08-06 10:15:44 +09:00
Yuya Nishihara
d435a8a793 tests: compare trees without using .diff_summary()
I don't think modification types matter here. Testing paths should be good
enough.
2024-08-06 10:15:44 +09:00
Yuya Nishihara
0b1a6cd9e0 cli: allow any number of trailing dashes in "JJ: describe" line
Because a line without " -------" is allowed, it makes sense to strip other
variants like " --".
2024-08-06 10:15:32 +09:00
Yuya Nishihara
fb3e120092 cli: minor style cleanup in parse_bulk_edit_message() 2024-08-06 10:15:32 +09:00
Yuya Nishihara
f7b8a22c66 cli: remove redundant string concatenation from parse_bulk_edit_message() 2024-08-06 10:15:32 +09:00
dependabot[bot]
1d482c71b8 cargo: bump the cargo-dependencies group with 2 updates
Bumps the cargo-dependencies group with 2 updates: [dunce](https://gitlab.com/kornelski/dunce) and [tempfile](https://github.com/Stebalien/tempfile).


Updates `dunce` from 1.0.4 to 1.0.5
- [Commits](https://gitlab.com/kornelski/dunce/compare/v1.0.4...v1.0.5)

Updates `tempfile` from 3.10.1 to 3.11.0
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.10.1...v3.11.0)

---
updated-dependencies:
- dependency-name: dunce
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-05 18:51:04 +02:00
Yuya Nishihara
f4dd856f9f ui: do not write() to channel if builtin pager has terminated 2024-08-05 10:34:33 +09:00
Yuya Nishihara
ce2bc8d6b6 ui: include error sources in pager warning
An error in builtin pager can be nested.
2024-08-05 10:21:23 +09:00
Benjamin Tan
35b04f45dc describe: allow updating the description of multiple commits
If multiple commits are provided, the description of each commit
will be combined into a single file for editing.
2024-08-05 02:06:40 +08:00
Ilya Grigoriev
37ccfd5acc built-in pager: write a message to the user if pager failed to start
The message is printed at the end, any text sent to the pager before
then is lost. See
https://github.com/martinvonz/jj/pull/4197#discussion_r1701799135
for a discussion about why that seems OK.
2024-08-03 17:45:18 -07:00
Yuya Nishihara
9ec617534c cli: merge op heads and snapshot working copy by "op log" by default
This partially reverts 543036c753 "cli: run 'op log' without loading repo or
merging concurrent ops." User can now get around the issue by --at-op=@
--ignore-working-copy.
2024-08-03 09:22:26 +09:00
Yuya Nishihara
5bfb3742e8 cli: migrate trivial uses of op_walk::resolve_op_for_load()
Now heads merging can be turned off by --at-op=@.
2024-08-03 09:22:26 +09:00
Yuya Nishihara
2008991749 cli: do not attempt to merge op heads if --at-op=@ is specified
The idea is that --at-op specifies a certain operation, so --at-op=@ can be
interpreted as the option to select _the_ known head operation. This helps
eliminate special cases from "op log" which doesn't snapshot nor merge
concurrent ops.
2024-08-03 09:22:26 +09:00
Yuya Nishihara
b290af8e29 op_walk: include operation ids in multiple match error 2024-08-03 09:22:26 +09:00
Yuya Nishihara
e9d744db32 tests: add crash recovery test from bad GC
The current "op abandon" and "op log" have workarounds to recover from this
situation. Let's make sure they work as expected.
2024-08-03 09:22:26 +09:00
Yuya Nishihara
cf053b7e09 ui: print :builtin pager suggestion as a hint 2024-08-03 09:14:29 +09:00
Yuya Nishihara
b503ecb071 ui: rewrite request_pager() to return early and use stdout instance 2024-08-03 09:14:29 +09:00
Yuya Nishihara
47a4406f4d ui: extract finalize_pager() as UiOutput method 2024-08-03 09:14:29 +09:00
Fedor Sheremetyev
c43096ba96 docs: Fix example with Git conflicts markers 2024-08-02 10:36:38 -07:00
dependabot[bot]
32b76a2c0a cargo: bump the cargo-dependencies group with 2 updates
Bumps the cargo-dependencies group with 2 updates: [regex](https://github.com/rust-lang/regex) and [serde_json](https://github.com/serde-rs/json).


Updates `regex` from 1.10.5 to 1.10.6
- [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.10.5...1.10.6)

Updates `serde_json` from 1.0.121 to 1.0.122
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.121...v1.0.122)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-02 18:05:14 +02:00
Martin von Zweigbergk
5b2259445e FAQ: remove workaround for fixed bug (#2476) 2024-08-01 09:07:32 -07:00
Stephen Jennings
6c41b1bef8 revset: add author_date and committer_date revset functions
Author dates and committer dates can be filtered like so:

    committer_date(before:"1 hour ago") # more than 1 hour ago
    committer_date(after:"1 hour ago")  # 1 hour ago or less

A date range can be created by combining revsets. For example, to see any
revisions committed yesterday:

    committer_date(after:"yesterday") & committer_date(before:"today")
2024-08-01 09:04:07 -07:00
Stephen Jennings
ff9e739798 revset: create DatePattern type
Creates a DatePattern type that can be created by parsing a string in any
format supported by the chrono-english crate, including:

- 2024-03-25
- 2024-03-25T00:00:00
- 2024-03-25T00:00:00-08:00
- 2 weeks ago
- 5 minutes ago
- yesterday
- yesterday 5pm
- yesterday 10:30
- yesterday 15:30
- tomorrow

A `kind` can be specified to indicate whether the pattern should match dates at
or after (`after`) or strictly before (`before`) the given instant.

chrono-english supports US and UK dialects to disambiguate mm/dd/yy from
dd/mm/yy, but for now we default to US. This should probably be a config
setting.
2024-08-01 09:04:07 -07:00