# HG changeset patch # User Yuya Nishihara # Date 1513502895 -32400 # Node ID 0279c2267d00afce7ce69ada6c520a0b06597569 # Parent 88572b7e50fd5f0e86329943795f6a3e38a2ec31 hgweb: disable diff.noprefix option for diffstat Copied from cf1e15f91c90. diff -r 88572b7e50fd -r 0279c2267d00 mercurial/hgweb/webutil.py --- a/mercurial/hgweb/webutil.py Thu Dec 14 22:07:46 2017 +0900 +++ b/mercurial/hgweb/webutil.py Sun Dec 17 18:28:15 2017 +0900 @@ -545,7 +545,8 @@ def diffstatgen(ctx, basectx): '''Generator function that provides the diffstat data.''' - stats = patch.diffstatdata(util.iterlines(ctx.diff(basectx))) + stats = patch.diffstatdata( + util.iterlines(ctx.diff(basectx, noprefix=False))) maxname, maxtotal, addtotal, removetotal, binary = patch.diffstatsum(stats) while True: yield stats, maxname, maxtotal, addtotal, removetotal, binary diff -r 88572b7e50fd -r 0279c2267d00 tests/test-hgweb-diffs.t --- a/tests/test-hgweb-diffs.t Thu Dec 14 22:07:46 2017 +0900 +++ b/tests/test-hgweb-diffs.t Sun Dec 17 18:28:15 2017 +0900 @@ -306,6 +306,23 @@ +set up hgweb with git diffs + noprefix + + $ killdaemons.py + $ hg serve --config 'diff.git=1' --config 'diff.noprefix=1' -p $HGPORT -d \ + > --pid-file=hg.pid -A access.log -E errors.log + $ cat hg.pid >> $DAEMON_PIDS + +patch header and diffstat + + $ get-with-headers.py localhost:$HGPORT 'rev/0' \ + > | egrep 'files changed|---|\+\+\+' + 2 files changed, 2 insertions(+), 0 deletions(-) + --- /dev/null + +++ a + --- /dev/null + +++ b + set up hgweb with git diffs $ killdaemons.py