mirror of
https://github.com/zoriya/jj.nvim.git
synced 2026-08-05 10:46:08 +00:00
feat(resolve): add resolve command and log integration (#125)
Add first-class conflict resolution support to jj.nvim.
- add `jj.cmd.resolve` to run `jj resolve` in a floating terminal or via an
external tool
- add `:J resolve` with support for `-r/--revision`, `--tool`,
`--external/--ext`, and positional filesets
- integrate resolve into the log buffer with the `gr` mapping and optional
`resolve_strategies` picker
- add `utils.is_change_conflicted()` and avoid opening resolve when the
selected revision has no conflicts
- document resolve usage, config, and keymaps in the README
- add tests for resolve arg parsing and conflict detection helpers
This commit is contained in:
@@ -644,6 +644,24 @@ function M.is_change_empty(revset)
|
||||
return vim.trim(output) == "true"
|
||||
end
|
||||
|
||||
--- Check if a given revset has conflicts
|
||||
--- @param revset string The revset to check
|
||||
--- @return boolean True if the revset has conflicts, false otherwise
|
||||
function M.is_change_conflicted(revset)
|
||||
local output, success = runner.execute_command(
|
||||
string.format("jj log --no-graph -r %s -T 'conflict' --quiet", vim.fn.shellescape(revset)),
|
||||
"Error checking if revset has conflicts",
|
||||
nil,
|
||||
true
|
||||
)
|
||||
|
||||
if not success or not output then
|
||||
return false
|
||||
end
|
||||
|
||||
return vim.trim(output) == "true"
|
||||
end
|
||||
|
||||
--- Build describe text for a given revision
|
||||
--- @param revset? string The revision to describe (default: @)
|
||||
--- @return string[]|nil
|
||||
|
||||
Reference in New Issue
Block a user