Skip to content

Commit ee1420e

Browse files
committed
fix(hg): Run hg status when numstat and namestat info do not match
1 parent ff8e57a commit ee1420e

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lua/diffview/vcs/adapters/hg/init.lua

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -649,13 +649,13 @@ HgAdapter.file_history_worker = async.void(function(self, co_state, opt, callbac
649649
-- Status is PROGRESS
650650
assert(new_data, "No data received from scheduler!")
651651

652-
-- 'git log --name-status' doesn't work properly for merge commits. It
653-
-- lists only an incomplete list of files at best. We need to use 'git
652+
-- 'hg log' doesn't work properly for merge commits. It
653+
-- lists only an incomplete list of files at best. We need to use 'hg
654654
-- show' to get file statuses for merge commits. And merges do not always
655655
-- have changes.
656656
if new_data.merge_hash
657657
and new_data.numstat[1]
658-
and #new_data.numstat ~= #new_data.namestat
658+
or (#new_data.numstat -1) ~= #new_data.namestat
659659
then
660660
local job = Job({
661661
command = self:bin(),
@@ -668,10 +668,6 @@ HgAdapter.file_history_worker = async.void(function(self, co_state, opt, callbac
668668
state.old_path or state.path_args
669669
),
670670
cwd = self.ctx.toplevel,
671-
-- Git sometimes fails this job silently (exit code 0). Not sure why,
672-
-- possibly because we are running multiple git opeartions on the same
673-
-- repo concurrently. Retrying the job usually solves this.
674-
retry = 2,
675671
fail_cond = Job.FAIL_COND.on_empty,
676672
log_opt = { label = "HgAdapter:file_history_worker()" },
677673
})

0 commit comments

Comments
 (0)