Commit graph

926 commits

Author SHA1 Message Date
Yuya Nishihara
7232dac7e9 cli: pass UserSettings in to diff_util::diff_formats_for*()
This and the subsequent patches prepare for the removal of ui.settings().
Ui will be a consumer of UserSettings (or config::Config) to make it clear
that Ui can be constructed before UserSettings is fully set up.
2023-01-05 07:56:03 +09:00
Yuya Nishihara
d99c299ee0 cli: set StoreFactories directly by CommandHelper::new() 2023-01-05 07:56:03 +09:00
Yuya Nishihara
f89f91a18b cli: instantiate CommandHelper by caller of parse_args()
parse_args() doesn't know all parameters needed to set up CommandHelper,
and we have to set StoreFactories later. That's okay for now, but I'm going
to add more parameters derived from CliRunner.
2023-01-05 07:56:03 +09:00
Yuya Nishihara
d48d080c4b cli: extract first half of parse_args() to new function
The next commit will move CommandHelper construction to the caller of
parse_args(). Without this change, parse_args() would have to return a tuple
of 3 elements, which seemed a bit too much.
2023-01-05 07:56:03 +09:00
Yuya Nishihara
ca73e39ead cli: for ColorChoice, implement fmt::Display instead of ToString
And inline {choice}.
2023-01-05 07:56:03 +09:00
Ilya Grigoriev
b293d72dfd Put timestamp config for tests into debug namespace 2023-01-03 23:02:46 -08:00
Ilya Grigoriev
79aaf117ea Put an RNG in user settings with configurable seed
Some hijinx are utilized to make it possible to generate
random values using an immutable `&UserSettings` reference.
2023-01-03 23:02:46 -08:00
Ilya Grigoriev
e8b21c5ce0 Change with_toml_strings to incorporate_toml_string
It makes more sense for this function to change `self`.
2023-01-03 23:02:46 -08:00
Yuya Nishihara
6d8d495075 cli: port custom command dispatch to CliRunner
Box<dyn> isn't technically needed, but it simplifies the type signature. Type
alias is added to silence clippy warning.
2023-01-04 15:48:38 +09:00
Yuya Nishihara
e0690f9d66 cli: pass CommandHelper to dispatch function by reference
This allows us to chain custom dispatch functions. If CommandHelper were
moved or passed by mutable reference, weird thing could happen depending
on the call order.
2023-01-04 15:48:38 +09:00
Yuya Nishihara
0110814885 cli: integrate custom StoreFactories registration with CliRunner
.set_store_factories() could be invoked for any CliRunner<F> type, but
I don't care much about that since the type parameter F will be removed
soon.
2023-01-04 15:48:38 +09:00
Yuya Nishihara
f34f764b9f cli: migrate custom command augmentation and parse_args() to CliRunner
CommandHelper is passed by move because custom-backend/main.rs mutates it.
This will be addressed by the next commit.
2023-01-04 15:48:38 +09:00
Yuya Nishihara
9296ae6eb4 cli: add builder type that handles CLI initialization and teardown
parse_args() will probably become more involved to deal with --config-toml,
-R, and repository configs. This builder will hopefully allow us to move
things around without changing the high-level interface.
2023-01-04 15:48:38 +09:00
David Barnett
406be5e043 Add "jj debug config-schema" command to output JSON schema
Extends TOML/JSON schema changes from #966 to allow jj to output the
schema directly. Context in #879.
2023-01-03 22:02:25 -06:00
Yuya Nishihara
9763a4d689 cli: move --verbose handling to parse_args(), enable it in custom examples 2023-01-04 11:56:53 +09:00
Yuya Nishihara
dbcfb00d2c cli: extract thin wrapper for tracing initialization
I'm going to add a high-level abstraction to hide details of the CLI startup,
but a low-level wrapper like this would still be useful.
2023-01-04 11:56:53 +09:00
David Barnett
01e656efbe Define config TOML/JSON schema
Can be used with tools like taplo-lsp to show hints & validation in
editors/IDEs. Won't apply automatically to config files until it's
submitted to schemastore.org, but in the meantime it can be used via a
schema directive
(https://taplo.tamasfe.dev/configuration/directives.html#the-schema-directive)
or other manual config mechanism.

Context in #879.
2023-01-02 20:26:28 -06:00
Waleed Khan
67cb20611e cli_util: fix typo in From<BackendError>
This error message was confusing because I thought the error was coming directly from the store, not via the backend.
2023-01-02 12:28:51 -06:00
Waleed Khan
7f8a196ab2 backend: create ObjectId trait
This lets us operate over various kinds of objects polymorphically (e.g. call `.hex()` on any kind of object hash).
2023-01-02 12:28:51 -06:00
Yuya Nishihara
6586a756c1 cli: inline create_ui(), use ? to handle config error 2023-01-02 14:14:50 +09:00
Yuya Nishihara
1b45c5fe8e cli: use ui.reset() to process --config-toml arguments
This should also fix handling of --config-toml 'colors...'. Before, the color
table wouldn't be updated without mode change.
2023-01-02 14:14:50 +09:00
Yuya Nishihara
fa68a21bd1 cli: create default ui, then reconfigure with loaded user settings
This function will probably be used to apply settings loaded from
.jj/repo/config.toml.
2023-01-02 14:14:50 +09:00
Yuya Nishihara
da95ae65be cli: extract Ui::new() that creates ui with default config
Since ui object is needed to report read_config() error, it makes sense to
create ui first without fallible user configuration. Ui::for_terminal() will
be replaced with this function and ui.reset(read_config()?).

Default::default() is also added to silence clippy. If we prefer, Ui::new()
can be replaced with Ui::default().
2023-01-02 14:14:50 +09:00
Waleed Khan
cf8c2b0717 cli_util: fix typo 2022-12-31 02:57:26 -06:00
Augie Fackler
f64d8f45ae Commands: Alias commit to ci for cvs/mercurial/svn compatability
As far as I can tell it won't hurt anyone to have this alias exist, but will
help those of us with old muscle memory.
2022-12-30 09:26:55 -05:00
David Barnett
e824c491bf Add a "config" command with "get" and "list" subcommands
Partially fixes #531.
2022-12-27 16:59:20 -06:00
Martin von Zweigbergk
d86ba708a3 repo: add MutableRepo::rewrite_commit() returning CommitBuilder
Same reasoning as the previous commit.
2022-12-26 23:30:52 -08:00
Martin von Zweigbergk
812ef97adb repo: add MutableRepo::new_commit() returning CommitBuilder
Since `CommitBuilder` now has a reference to `MutableRepo`, it's
convenient to create instances of it by calling a method on
`MutableRepo`.
2022-12-26 23:30:52 -08:00
Martin von Zweigbergk
f3208f59c4 store: propagate error from Backend::write_commit() 2022-12-26 23:30:52 -08:00
Martin von Zweigbergk
49b2f3b6ca commit_builder: keep MutableRepo reference
When you're done with the `CommitBuilder`, you're going to have to
call `write_to_repo()`, passing it a mutable `MutableRepo`
reference. It's a bit simpler to pass that reference when we create
the `CommitBuilder` instead, so that's what this patch does.

A drawback of passing in the mutable reference when we create the
builder is that we can't have multiple unfinished `CommitBuilder`
instance live at the same time. We don't have any such use cases yet,
and it's not hard to work around them, so I think this change is worth
it.
2022-12-26 23:30:52 -08:00
Martin von Zweigbergk
5cb3807b26 colors: move defaults from source to file 2022-12-24 07:07:37 -08:00
Martin von Zweigbergk
6514ab2e3a cli: when config is invalid, use default config
When we fail to read the user's config, it seems obviously better to
use the default config than to not use it. It doesn't matter yet, but
it will matter when I've moved color configs out of `formatter.rs` and
into a `.toml` file. Without this change, we'd lose the default
coloring of the error message for config errors.
2022-12-24 07:07:37 -08:00
Martin von Zweigbergk
462f696e4e config: add a README to explain that the config files are not installed 2022-12-24 07:07:37 -08:00
Martin von Zweigbergk
b22a6db7e7 config: move default merge-tool config into config/ directory
I'm about to add more default configs, so it will be good to collect
them in one directory.
2022-12-24 07:07:37 -08:00
Ilya Grigoriev
5a681d31d0 cmd jj log: Move divergent label next to the change id
The divergent label is most relevant when the user is about to
refer to a commit by its change id.

It's also good to put it far from the `conflicts` label, to
reduce confusion between very different concepts that have
similar names.

Finally, I think it is a feature rather than a bug that the
`divergent` label now upsets the alignment of different lines
of `jj log`.
2022-12-22 17:25:16 -08:00
Benjamin Saunders
d99e85269f cli: fix core.excludesFile default when XDG_CONFIG_HOME is set 2022-12-22 10:03:20 -08:00
Yuya Nishihara
48cf32f559 cli: simply assign result of if expression in cmd_describe() 2022-12-23 00:47:22 +09:00
Yuya Nishihara
2550dcae4c cli: include diff summary in commit/describe editor content 2022-12-23 00:47:22 +09:00
Yuya Nishihara
d438f43224 cli: rephrase diff summary header so it can be reused for commit/describe 2022-12-23 00:47:22 +09:00
Yuya Nishihara
e7d9e1ff9c cli: inline diff_util::diff_as_bytes()
I'll add a similar function that uses show_patch() instead of show_diff(),
and I don't think it's worth duplicating _as_bytes() part for that.
2022-12-23 00:47:22 +09:00
Yuya Nishihara
300f744e41 cli: normalize line ending of edited commit description, ensure last newline
Since CR+LF vs LF things shouldn't matter in commit description, it's probably
better to normalize newline characters.

In Mercurial, ui.edit() and changelog.stripdesc() handle line normalization,
and trailing newlines are stripped. In Git, cleanup_message() handles that,
and the last newline is added after stripping trailing newlines.
2022-12-22 14:59:03 +09:00
Yuya Nishihara
6f8fb09609 cli: append "\n" to commit description specified by -m/--message
Otherwise the description set by -m would differ from the one set by editor.
This fixes test_describe() which says "make no changes", but previously "\n"
would be added by the second "jj describe".

As you can see, almost all hashes change in CLI tests. This means in-flight
PRs will need to be rebased to update insta snapshots.

Description text could be normalized by CommitBuilder, but the caller would
have to normalize it beforehand to compare with the current description, so
we would need an explicit function anyway. Another idea is to add a newtype
that represents a normalized description, and make CommitBuilder require it.
Commit::description() will return &Description in place of &str to ensure
that commit.description() == raw_str wouldn't compile.

Git CLI provides --cleanup=<mode> option to switch normalization rules, but
I don't think we'll need such feature.
2022-12-22 14:59:03 +09:00
Yuya Nishihara
986649623d commit_builder: relax type of description parameter
The next commit will introduce a newtype for -m/--message argument which
can be converted Into<String>.

Since CommitBuilder is a thin wrapper, code bloat caused by generic parameters
wouldn't matter. I have another set of commits that makes all builder methods
accept Into/IntoIterator, which will remove some of .clone() calls from tests.
2022-12-22 14:59:03 +09:00
Ilya Grigoriev
18722bbf36 cmd: Remove the -i option to jj restore.
It is superceded by the new options to the `jj diffedit` command.
2022-12-21 08:15:06 -08:00
Ilya Grigoriev
c9706fc0d4 Rename jj touchup to jj diffedit 2022-12-21 08:15:06 -08:00
Ilya Grigoriev
f71ca25ebe cmd: Add --to and --from arguments to jj touchup
This allows touching up a commit while seeing the differences between it and
another arbitrary commit.
2022-12-21 08:15:06 -08:00
Yuya Nishihara
a850c488f9 cli: use fs::read_to_string() to read edited description file
Also removes panic on io::Error. It's unlikely, but could occur if the
edited description contained non-UTF-8 character.
2022-12-21 23:48:51 +09:00
Yuya Nishihara
cc2091aad6 cli: leverage tempfile to create commit description file with random suffix
This should be more reliable as there might be a stale description file
having the exact same random suffix.

Also removes panic on io::Error.
2022-12-21 23:48:51 +09:00
Ilya Grigoriev
0285a203a2 Rearrange branches of if statement in jj git push 2022-12-21 00:52:17 -08:00
Ilya Grigoriev
2f00fcb6b4 jj git push: Make sure each branch is processed at most once 2022-12-21 00:52:17 -08:00
Ilya Grigoriev
fad686f48c Allow jj git push to push multiple branches/changes at once
Also creates short arg `-b` for `--branch`.
2022-12-21 00:52:17 -08:00
Benjamin Saunders
b222bbd10a cli: respect default value of git core.excludesFile 2022-12-21 00:18:55 -08:00
Martin von Zweigbergk
a2d2da4d48 cli: remove unnecessary (?) ArgAction::Append in $[clap]
I think "append" is the default for `Vec`-type fields.
2022-12-18 17:51:58 -08:00
Ilya Grigoriev
dac80ef88c Rename diff_edit.rs to merge_tools.rs
This is important especially since we're about to rename the `touchup` command into `diffedit`.
2022-12-17 22:26:59 -08:00
Ilya Grigoriev
f96f45125e Rename merge-tools.toml to merge_tool_config.toml
I think this fits in better with the other files in this dir
and is more descriptive.
2022-12-17 22:08:50 -08:00
Ilya Grigoriev
8f9cc3f4e8 Instructions and better config for Vim as a diff editor
After I changed `merge-tools.vimdiff.program` to `vim`, using
`vimdiff` as a diff editor wouldn't work at all. 

Out of the box, it's still not a good experience. I included a
recommendation of a plugin to install to make it better.
2022-12-17 22:08:50 -08:00
Daniel Ploch
309a3f91a1 op_heads_store: refactor into an interface and simple implemenation
The implementation has some hoops to jump through because Rust does not allow
`self: &Arc<Self>` on trait methods, and two of the OpHeadsStore functions need
to return cloned selves. This is worked around by making the implementation type
itself a wrapper around Arc<>.

This is not particularly note worthy for the current implementation type where
the only data copied is a PathBuf, but for extensions it is likely to be more
critical that the lifetime management of the OpHeadsStore is properly
maintained.
2022-12-16 10:47:48 -08:00
Yuya Nishihara
af85f552b6 cli: do not unwrap BackendError at resolve_revset() 2022-12-16 13:34:58 +09:00
Yuya Nishihara
4e8f51a983 cleanup: leverage Itertools::try_collect() instead of turbofish
It still requires return type annotation in some places, but should be easier
to type than ::<Result<...

https://docs.rs/itertools/latest/itertools/trait.Itertools.html#method.try_collect
2022-12-16 13:34:58 +09:00
Yuya Nishihara
9158c96202 cli: show hint if e.g. checkout revset resolved to multiple revisions
As suggested at
https://github.com/martinvonz/jj/issues/878#issuecomment-1345466602
2022-12-15 22:55:29 +09:00
Yuya Nishihara
6889d64ffc cli: unnest resolve_single_rev() error handling bits
I'll add more code to (Some, Some) arm, so let's extract the successful
case for readability.
2022-12-15 22:55:29 +09:00
Yuya Nishihara
62a38d3e86 cli: add kdiff3 edit-args to stock config 2022-12-15 15:16:50 +09:00
Yuya Nishihara
52e26a8d9a cli: move merge-tools name to [table] header
Even though we need to repeat "merge-tools", I feel it's a bit better to
group parameters by tool name. Tools are sorted by name.
2022-12-15 15:16:50 +09:00
Yuya Nishihara
c86f7f87e4 cli: add comment why stock config isn't add_source()-d to main config_builder 2022-12-15 15:16:50 +09:00
Yuya Nishihara
0a28b2c508 cli: extract stock merge-tools config to file, embed it in binary
I think a separate .toml file is easier to maintain as the merge-tools
table will grow.
2022-12-15 15:16:50 +09:00
Martin von Zweigbergk
7f9a0a2820 cleanup: let new Clippy move variables into format strings
I ran an upgraded Clippy on the codebase. All the changes seem to be
about using variables directly in format strings instead of passing
them as separate arguments.
2022-12-14 21:30:58 -08:00
Martin von Zweigbergk
c8a04d6f69 cli: use .display() instead of debug format in two errors 2022-12-14 21:30:58 -08:00
Yuya Nishihara
cec4d6c214 cli: allow multiple diff outputs
"jj log -p --summary" now shows summary and color-words diff, like
"hg log -p --stat".

Handling of "-p" is tricky. I first considered "-p" would turn on the default
diff output, but I found it would be confusing if "jj log -p --git" showed
both color-words and git diffs. So the default format is inserted only if
no --git nor --color-words is explicitly specified.
2022-12-15 11:41:42 +09:00
Yuya Nishihara
07cf103ac1 cli: pass from/to_tree in to show_diff() instead of TreeDiffIterator
This allows us to generate diff in different formats. There are various ways
to achieve that:

 a. build TreeDiffIterator for each format (this patch)
 b. make TreeDiffIterator clonable
 c. collect TreeDiffIterator and reuse the resulting vec

(a) and (b) are practically the same. (c) would be more efficient if building
and iterating TreeDiffIterator were expensive, but I don't think it is because
Tree is cached by Store. If we add $GIT_EXTERNAL_DIFF-like feature, we'll
probably need Tree objects to snapshot them to /tmp. So I chose (a).
2022-12-15 11:41:42 +09:00
Yuya Nishihara
69e57daa64 cli: enable diff output by 'log --color-words'
It doesn't make sense that --git implies -p, but --color-words doesn't.
2022-12-15 11:41:42 +09:00
Yuya Nishihara
b4d6c9e8da cli: extract helper that resolves diff arguments for log-like commands 2022-12-15 11:41:42 +09:00
Yuya Nishihara
cdf3bfa55f cli: extract default_diff_format() from diff_format_for()
I'll make "jj log -p --summary" show both summary and diff, where -p will
be resolved to the default diff format.
2022-12-15 11:41:42 +09:00
Yuya Nishihara
f26582d0a3 cli: leverage show_patch() helper to implement show command 2022-12-15 11:41:42 +09:00
Martin von Zweigbergk
b28ff2fbd9 cli: use committer timestamp instead of author timestamp in log output
The author timestamp is rarely useful (in my experience). The
committer timestamp, on the other hand, can be useful for
understanding when a change was most recently modified. IIRC, I
originally picked the author timestamp to match the email (which is
the author's), but it's probably not confusing to use the author email
and the committer timestamp. I suspect few users will even reflect on
it.
2022-12-14 15:48:11 -08:00
Daniel Ploch
7cbea42a24 repo: rename BackendFactories to StoreFactories 2022-12-14 14:10:30 -08:00
Yuya Nishihara
dce45794df cli: move show_patch() to diff_util
I think this belongs to the same category as show_diff().
2022-12-14 15:24:50 +09:00
Yuya Nishihara
dff53b1200 cli: simplify match arms in diff_format_for() 2022-12-14 15:24:50 +09:00
Yuya Nishihara
5e490f310f cli: extract show_diff*() functions and structs to new module
I think these functions are big enough to be separated from random chunk
of command functions.
2022-12-14 15:24:50 +09:00
Yuya Nishihara
73ea5cd56e cli: parse early args in/after alias properly
Follows up aa2ce88544 'cli: process args to "--help" and "help"'.
2022-12-14 13:51:23 +09:00
Yuya Nishihara
5dc73ab7ad cli: do not raise ClapError from resolve_aliases()
This allows us to process early args after alias resolution.
2022-12-14 13:51:23 +09:00
Glen Choo
aa2ce88544 cli: process args to "--help" and "help"
Clap bails parsing when an "error" is encountered, e.g. a subcommand is missing,
"--help" is passed, or the "help" subcommand is invoked. This means that the
current approach of parsing args does not handle flags like `--no-pager` or
`--color` when an error is encountered.

Fix this by separating early args into their own struct and preprocessing them
using `ignore_errors` (per https://github.com/clap-rs/clap/issues/1880).

The early args are in a new `EarlyArgs` struct because of a known bug where
`ignore_errors` causes default values not to be respected
(https://github.com/clap-rs/clap/issues/4391 specifically calls out bool, but
strings may also be ignored), so when `ignore_errors` is given, the default
values will be missing and parsing will fail unless the right arg types are used
(e.g`. Option`). By parsing only early args (using the new struct) we only need
to adjust `no_pager`, instead of adjusting all args with a default value.
2022-12-14 04:50:14 +08:00
Glen Choo
a31897146f cli: paginate help
This does not respect "--no-pager", support will be added in the next
commit.
2022-12-14 04:50:14 +08:00
Yuya Nishihara
67be440f4a cli: resolve operation symbol first and apply '-' postfix repeatedly
Just like revsets.
2022-12-13 09:28:48 +09:00
Yuya Nishihara
57e5a3be65 cli: reorder resolve_op_for_load() to fall back to resolve_single_op()
I'll add multiple '-' resolution to resolve_single_op().
2022-12-13 09:28:48 +09:00
Waleed Khan
91ead75e43 feat(branch): support jj branch forget --glob 2022-12-10 16:51:10 -08:00
Danny Hooper
6787e17254 Do not use "..." between diff chunks when it only replaces 1 line of the diff
The number of lines in the diff output is unchanged.

This makes diffs a little more readable when the "..." would otherwise hide a
single line of code that helps in understanding the surrounding context lines.

This change mostly rearranges the loop that consumes the diff lines, so it can
buffer up to num_context_lines*2+1 lines instead of just num_context_lines.
There's a bit of extra code to handle times when a "..." replaces the last line
of a diff.

Note that `jj diff --git` is unchanged, and will still output `@@` lines that
replace a single line of context.
2022-12-09 20:39:40 -06:00
Martin von Zweigbergk
2a1c2e05ba cli: when colocated with Git, export refs on snapshot
This fixes the bug described in the previous commit.

Because we now print the message about failed exports also while
snapshotting, we may end up reporting it twice on one command. I'm not
sure it's worth worrying about that. We can deal with that later if it
turns out to be a common complaint.
2022-12-08 23:10:18 -08:00
Yuya Nishihara
b6e06f6dc9 cli: use deserialize to parse alias definition
Unfortunately, config::Value is lax and '[7]' could be parsed as '["7"]'.
I don't like it, but I think that's actually better for consistency as we
use config.get_string() in various places.
2022-12-07 23:26:11 +09:00
Yuya Nishihara
283231b1e4 cli: load all aliases to map first to suppress cryptic error
Otherwise 'jj foo.' would fail with 'Config error: Char'.
2022-12-07 23:26:11 +09:00
Yuya Nishihara
a45e00179c cli: on clone, turn local git remote to absolute path
Otherwise a subsequent git fetch would fail.
2022-12-07 14:14:31 +09:00
Martin von Zweigbergk
a0573b1737 cli: add a command for updating a stale working copy
When a workspace's working-copy commit is updated from another
workspace, the workspace becomes "stale". That means that the working
copy on disk doesn't represent the commit that the repo's view says it
should. In this state, we currently automatically it to the desired
commit next time the user runs any command in the workspace. That can
be undesirable e.g. if the user had a slow build or test run started
in the working copy. It can also be surprising that a checkout happens
when the user ran a seemingly readonly command like `jj status`.

This patch makes most commands instead error out if the working copy
is stale, and adds a `jj workspace update-stale` to update it. The
user can still run commands with `--no-commit-working-copy` in this
state (doing e.g. `jj --no-commit-working-copy rebase -r @ -d @--` is
another way of getting into the stale-working-copy state, by the way).
2022-12-05 08:50:52 -08:00
Martin von Zweigbergk
e1be0f5096 cli: extract a function for loading the workspace
I want to be able to create a `WorkspaceCommandHelper` without
snapshotting the working copy. That will be useful when adding a
command for updating a stale working copy.
2022-12-05 08:50:52 -08:00
Martin von Zweigbergk
18b80f4008 cli: make checking for stale working copy independent of UI
This patch makes the function checking for a stale working copy return
a specialized error instead of `CommandError`. That has several advantages:

 * It makes it easier to change the behavior so we don't automatically
   update a stale working copy until the user explicitly tells us.

 * It allows us to move the function to the library crate, to be
   shared by non-CLI UIs (and server applications).
2022-12-05 08:50:52 -08:00
Martin von Zweigbergk
f7d0c196c1 cli: extract a function for checking for stale working copy
Similar to the previous commit, the checking for stale working copy is
a big part of `commit_working_copy()` and it's logically quite
separated from the rest, so let's extract it to a function.
2022-12-05 08:50:52 -08:00
Martin von Zweigbergk
2282047d3b cli_util: extract a function for creating a helper given a workspace
The code for creating a `WorkspaceCommandHelper` for a given
`Workspace` is a well-separated part of the large
`workspace_helper()`, so lets extract it to a function.
2022-12-05 08:50:52 -08:00
Ilya Grigoriev
e9952bcf76 Minimal version of resolve --list
Simply lists conflicted files
2022-12-04 22:58:12 -08:00
Ilya Grigoriev
ea1395ad95 Make optional the path argument to resolve, allow partial paths
Also allows several paths to be specified. By default, `jj resolve`
will find the first conflict that matches provided paths (if any)
and try to resolve it.
2022-12-04 22:39:45 -08:00
Ilya Grigoriev
b58be8d7a4 Mention path in message for ConflictResolveError::NotNormalFilesError. 2022-12-04 22:39:45 -08:00
Martin von Zweigbergk
48c44344bf cli: make jj status not just care about the first parent
It seems like I forgot to update the `jj status` output when I decided
(years ago?) that the changes in a commit should always be compared to
the auto-merged parents. I was very confused before I realized that
`jj status` was showing the diff summary against the first parent. I
suppose the fact that `jj status` lists only one parent should have
been a hint. Thanks to ilyagr@ for finding this odd behavior. This
patch fixes it by making the command list all parents, and changes the
diff summary to be against the auto-merged parents.
2022-12-04 22:29:12 -08:00
Martin von Zweigbergk
dc8830843e cli: use pager for print
The `print` command shows the contents of a file, so that is obviously
often more than a page long. Both `hg cat file` and `git show
HEAD:file` page the output.
2022-12-04 20:52:29 -08:00