Bug 5759 - diff.noprefix disables --stat output
Summary: diff.noprefix disables --stat output
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 4.4.2
Hardware: PC Mac OS
: urgent bug
Assignee: Bugzilla
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2017-12-15 10:52 UTC by Kevin Bullock
Modified: 2017-12-28 05:55 UTC (History)
4 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Bullock 2017-12-15 10:52 UTC
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)
Comment 1 Marcus Harnisch 2017-12-16 16:45 UTC
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.
Comment 2 Gregory Szorc 2017-12-17 14:21 UTC
I just queued some patches for this. So this is most definitely in progress.
Comment 3 HG Bot 2017-12-18 13:25 UTC
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)
Comment 4 Bugzilla 2017-12-26 00:00 UTC
Bug was set to TESTING for 7 days, resolving
Comment 5 Marcus Harnisch 2017-12-28 05:55 UTC
(In reply to HG Bot from comment #3)
Thanks. The fix appears to work just fine.