Commit Graph

1254 Commits

Author SHA1 Message Date
dependabot[bot]
c49386043b cargo: bump clap from 3.1.15 to 3.1.16
Bumps [clap](https://github.com/clap-rs/clap) from 3.1.15 to 3.1.16.
- [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/v3.1.15...v3.1.16)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-06 08:51:48 -07:00
Martin von Zweigbergk
b94c78545b protos: use run_from_script() in build.rs
`run_from_script()` is effectively the same as we did with `.expect()`
(print the error to stderr and exit with an error).
2022-05-05 11:46:40 -07:00
Martin von Zweigbergk
c1d0c08c03 protos: move protos.rs into src/protos/
It's easier to find the file this way and not forget that it's part of
the setup for building with protos.
2022-05-05 11:46:40 -07:00
Martin von Zweigbergk
a59724b082 protos: move .proto files to more conventional src/protos/ 2022-05-05 11:46:40 -07:00
Martin von Zweigbergk
36ae9421ad github: don't override nixpkgs version (use the lock file's version)
I don't know what it was overridden here, but it meant that CI didn't
notice that the package was broken (#299).
2022-05-05 11:14:08 -07:00
Martin von Zweigbergk
3cf1d629c8 nix: update lock file to nixpkgs with rust toolchain 1.60
Closes #299
2022-05-05 10:55:53 -07:00
Martin von Zweigbergk
ffc57310f6 cargo: upgrade protobuf crates to 3.0.1
The biggest difference in the API is that fields are now public. The
exception from that is `oneof` fields, which still require setters and
getters.

I couldn't measure any difference in performance. I didn't expect any
difference either, but it's good that it didn't seem to regress. I
timed `jj debug operation <some hash prefix>`, which will read the
whole operation log (to check that the prefix is unambiguous).
2022-05-04 17:02:11 -07:00
Martin von Zweigbergk
cba89886e5 cleanup: replace some for x in xs.iter() by for x in &xs 2022-05-04 17:02:11 -07:00
dependabot[bot]
8a6cf4bb3b cargo: bump serde_json from 1.0.80 to 1.0.81
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.80 to 1.0.81.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.80...v1.0.81)

---
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-05-04 08:58:48 -07:00
dependabot[bot]
1f9a47c750 cargo: bump clap from 3.1.14 to 3.1.15
Bumps [clap](https://github.com/clap-rs/clap) from 3.1.14 to 3.1.15.
- [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/v3.1.14...v3.1.15)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-04 08:58:33 -07:00
dependabot[bot]
ad5cc029be cargo: bump serde from 1.0.136 to 1.0.137
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.136 to 1.0.137.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.136...v1.0.137)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-04 08:58:00 -07:00
Martin von Zweigbergk
efa77fd024 github: run clippy on all targets (including tests and benches) 2022-05-03 15:41:03 -07:00
Martin von Zweigbergk
cce2ca06e2 github: stop running nightly clippy
It seems fine to wait for the clippy lints to graduate before we run
them if we can save a bit of GitHub resources.
2022-05-03 15:41:03 -07:00
Martin von Zweigbergk
e4f83e353e errors: use custom error for failed tree merge
Tree merges can currently fail because of a failure to look up an
object, or because of a failure to read its contents. Both results in
`BackendError` because of a `impl From<std::io::Error> for
BackendError`. That's kind of correct in this case, but it wasn't
intentional (that impl was from `local_backend`), and we need to
making errors more specific for better error handling.
2022-05-03 06:52:00 -07:00
Waleed Khan
67be21d9cb cleanup: fix some cargo clippy warnings 2022-05-02 21:49:01 -07:00
Waleed Khan
7a551e584f cli: jj branch can accept any number of branches 2022-05-02 21:33:58 -07:00
Yuya Nishihara
f6acee41df diff_edit: load command arguments from merge-tools.<name> config
Apparently, I need to pass `--merge` option to use kdiff3 as a diff editor.

We could add `diff-editor-args` or extend `diff-editor` to a list of command
arguments, but we'll eventually add stock merge tools and the configuration
would look like:

    [merge-tools.<name>]
    program = ...
    diff-args = [...]
    edit-args = [...]
    merge-args = [...]
2022-05-03 12:24:05 +09:00
Martin von Zweigbergk
1f2753fd3f cli: fix incompatibility between #271 and #273
The two PRs were incompatible, but it seems they were allowed to
"merge" (rebase) because the merge was conflict free?
2022-05-02 17:46:06 -07:00
Martin von Zweigbergk
305adf05cc cli: when auto-importing from git, rebase descendants 2022-05-02 17:01:38 -07:00
Martin von Zweigbergk
726b29978d tests: show failure in git-shared working copy after deleting commit in git
Since 57ba9a9409, if the automatic import from git results in some
abandoned commit, that information gets recorded in the `MutableRepo`,
but I forgot to add a call to rebase the descendants. That causes a
failed assertion at
81a8cfefcb/lib/src/transaction.rs (L86). This
patch add a test showing that failure.
2022-05-02 17:01:38 -07:00
Waleed Khan
ed2b8643f8 docs: update README.md
The intention is to make it easier to jump to the Installation section.
2022-05-02 13:57:10 -07:00
Waleed Khan
7a99a17304 cli: make jj branch --revision/--delete/--forget mutually-exclusive 2022-05-02 13:44:17 -07:00
Martin von Zweigbergk
7268e5608e working_copy: propagate errors when snapshotting
Closes #258
2022-05-02 11:23:38 -07:00
dependabot[bot]
6649dbabae cargo: bump serde_json from 1.0.79 to 1.0.80
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.79 to 1.0.80.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.79...v1.0.80)

---
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-05-02 18:08:03 +00:00
dependabot[bot]
399cec09d7 cargo: bump clap_complete from 3.1.2 to 3.1.3
Bumps [clap_complete](https://github.com/clap-rs/clap) from 3.1.2 to 3.1.3.
- [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-v3.1.2...clap_complete-v3.1.3)

---
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-05-02 09:55:38 -07:00
dependabot[bot]
9ae642e11b cargo: bump thiserror from 1.0.30 to 1.0.31
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.30 to 1.0.31.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.30...1.0.31)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-02 09:46:59 -07:00
dependabot[bot]
0cb1033afd cargo: bump clap from 3.1.12 to 3.1.14
Bumps [clap](https://github.com/clap-rs/clap) from 3.1.12 to 3.1.14.
- [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/v3.1.12...v3.1.14)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-02 08:59:26 -07:00
Waleed Khan
4e026c6c93 diff_edit: add hint when using default editor 2022-05-02 08:19:23 -07:00
Martin von Zweigbergk
543a95c653 rewrite: propagate backend errors in DescendantRebase::rebase_next() 2022-05-02 08:05:24 -07:00
Martin von Zweigbergk
96b3e05bc5 working_copy: rename write_tree() to snapshot()
I think I copied the name `write_tree()` from Git, but I find it quite
confusing, since it's not clear if it write a tree to the working copy
or reads the working copy and writes a tree to the store (it's the
former).
2022-05-02 08:00:15 -07:00
Martin von Zweigbergk
90c8cb0cba errors: add a custom error type for StackedTable 2022-05-01 23:35:09 -07:00
Martin von Zweigbergk
89476261c0 cleanup: move {read,write}_conflict() methods earlier in Backend trait
The methods working on conflicts are more closely related to those
working on files and trees, so it makes sense for them to be closer.
2022-05-01 23:35:09 -07:00
Martin von Zweigbergk
b97fd381e5 diff_edit: delete unused error variant (since 9e9727af4e) 2022-05-01 22:58:18 -07:00
Martin von Zweigbergk
5bad272e90 docs: update stale references to -o argument deleted in 8744015f33 2022-05-01 16:33:27 -07:00
Martin von Zweigbergk
5893b52fd1 cleanup: use while let Some(...) instead of checking before popping 2022-05-01 13:45:00 -07:00
Waleed Khan
00a8abcdbb diff_edit: improve error handling
Used to produce a message like this:

```
thread 'main' panicked at 'failed to run diff editor: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/diff_edit.rs:136:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

Now produces a message like this:

```
Error: Failed to edit diff: Error executing editor 'meld': No such file or directory (os error 2)
```
2022-04-30 13:28:38 -07:00
Waleed Khan
2b843d418b cli: don't show bench/debug subcommands by default 2022-04-30 12:56:23 -07:00
Martin von Zweigbergk
81a8cfefcb cli: add a mode of pushing with branch taken from change ID
This adds `jj git push --change <revision>` which creates a branch
with a name based on the revision's change ID, and then pushes that
like with `--branch`. That can be useful so you don't have to manually
add the branch (and come up with a name for it). The created branch
behaves like any other branch, so it's possible to make it point to a
commit with a different change ID.
2022-04-29 15:55:03 -07:00
Martin von Zweigbergk
bc75b08f4b cli: extract a function for finding single-branch push update
This will be reused in the next commit.
2022-04-29 15:55:03 -07:00
Martin von Zweigbergk
6e30bd76f9 cargo: move some test deps to [dev-dependencies] 2022-04-29 14:25:55 -07:00
Martin von Zweigbergk
d42c71f48d errors: fix some easy error propagation in commands.rs
This is actually enough to fix #248, but I'll continue to work on
error handling for a while. I'd like to at least include the bad
object ID in this type of error messages.

Closes #248.
2022-04-29 14:10:16 -07:00
Martin von Zweigbergk
0719dae975 cli: add a command for listing git remotes and their URLs
As requested by @talpr. I added this is a separate new command `jj git
remote list`. One could also imagine showing the listing when there is
no sub-command specified to `jj git remote`, but we don't have other
commands that behave that way yet.

Closes #243
2022-04-29 14:08:24 -07:00
Martin von Zweigbergk
491d0e3b06 cli: add a debug command for showing information about an operation
This adds `jj debug operation <operation ID>`, which will print the
operation object and its associated view object.
2022-04-29 13:50:22 -07:00
Martin von Zweigbergk
23d37f9060 git_backend: delete obsolete (?) comment about not avoiding use of index
It seems to me that we have never created a Git index in order to
create a commit, not even in the earliest versions of the code (before
it was moved to Git).
2022-04-29 13:26:27 -07:00
Martin von Zweigbergk
dc32bb1f95 git: avoid creating a HashSet only to convert to a Vec 2022-04-28 22:46:50 -07:00
Martin von Zweigbergk
8ef00a3498 tests: re-run with insta crate version b9d99e87065b 2022-04-28 16:55:10 -07:00
Martin von Zweigbergk
57ba9a9409 git: when importing refs, abandon commits that were abandoned in git
Now that I'm using GitHub PRs instead of pushing directly to the main
branch, it's quite annoying to have to abandon the old commits after
GitHub rebases them. This patch makes it so we compare the remote's
previous heads to the new heads and abandons any commits that were
removed on the remote. As usual, that means that descendants get
rebased onto the closest remaining commit.

This is half of #241. The other half is to detect rewritten branches
and rebase on top.
2022-04-28 11:28:09 -07:00
Martin von Zweigbergk
e3254fa5c4 rewrite: don't rewrite the "removed" side of a branch conflict
Let's say we have a simple history like this:

```
B C D
 \|/
  A
```

Branch `main` initially points to commit B. Two concurrent operations
then move the branch to commits C and D. When the two concurrent
operations get merged, the branch will be recorded as pointing to
"C+D-B". If a subsequent operation now abandons commit B, we would
update the "removed" side of the branch conflict. That seems a little
dishonest. I think the reason I did it that way was in order to not
keep B visible back when having it present in the "removed" side would
keep it visible (before 33bf6ce1d5).

I noticed this issue while working on #241 because
`test_import_refs_reimport()` started failing. That test case is
pretty much exactly the case above.
2022-04-28 11:28:09 -07:00
dependabot[bot]
aff2293e1d github: bump github/codeql-action from 2.1.8 to 2.1.9
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.8 to 2.1.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](1ed1437484...7502d6e991)

---
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-04-28 08:49:42 -07:00
Martin von Zweigbergk
0789a8a4c0 revsets: allow single internal - and + characters in symbols (#46) 2022-04-28 08:14:15 -07:00