With diff.noprefix=True, 'hg diff --stat' shows nothing. 'hg log --stat' also fails to show the diffstat output. To reproduce: $ hg init a $ cd a $ cat >> .hg/hgrc <<EOF > [diff] > noprefix = True > EOF $ echo a>a $ hg ci -Am0 $ hg diff --change . --stat $ hg log -r. -Tstatus --stat changeset: 0:f39c96ff5c7e tag: tip user: Kevin Bullock <kbullock@ringworld.org> date: Fri Dec 15 09:46:57 2017 -0600 summary: 0 files: A a $ hg log -pr. -Tstatus --stat changeset: 0:f39c96ff5c7e tag: tip user: Kevin Bullock <kbullock@ringworld.org> date: Fri Dec 15 09:46:57 2017 -0600 summary: 0 files: A a diff --git a a new file mode 100644 --- /dev/null +++ a @@ -0,0 +1,1 @@ +a (possibly related to https://bz.mercurial-scm.org/show_bug.cgi?id=4755)
Thanks for filing the ticket on my behalf, Kevin. Back home I failed to reproduce this and found that with a clean .hgrc I needed to additionally enable '--git' to trigger the issue. Doing the same via command line opts triggers the issue, too.
I just queued some patches for this. So this is most definitely in progress.
Fixed by https://mercurial-scm.org/repo/hg/rev/058c725925e3 Yuya Nishihara <yuya@tcha.org> diff: disable diff.noprefix option for diffstat (issue5759) We could use patch.diffhunks() instead of patch.diff() to get filenames without parsing patch content, but that isn't always possible because we sometimes feed raw patch data to patch.diffstat(). (please test the fix)
Bug was set to TESTING for 7 days, resolving
(In reply to HG Bot from comment #3) Thanks. The fix appears to work just fine.