# HG changeset patch # User Mateusz Kwapich # Date 1450378806 28800 # Node ID 186f2afe991956f75026a47bc6114de884501a4c # Parent 64208bd4c580e89373a2ab9a513f9f210b2c2db4 patch: disable nobinary when HGPLAIN=1 The diff output without binaries is definitely great for interactive users - a binary patch is not meaningful for them. Although setting diff.nobinary flag can break the automation. Let's force full output for automation. diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -2146,7 +2146,7 @@ 'ignoreblanklines') if formatchanging: buildopts['text'] = opts and opts.get('text') - buildopts['nobinary'] = get('nobinary') + buildopts['nobinary'] = get('nobinary', forceplain=False) buildopts['noprefix'] = get('noprefix', forceplain=False) return mdiff.diffopts(**buildopts) diff --git a/tests/test-diff-binary-file.t b/tests/test-diff-binary-file.t --- a/tests/test-diff-binary-file.t +++ b/tests/test-diff-binary-file.t @@ -44,6 +44,26 @@ diff --git a/binfile.bin b/binfile.bin Binary file binfile.bin has changed + $ HGPLAIN=1 hg diff --config diff.nobinary=True --git -r 0 -r 1 + diff --git a/binfile.bin b/binfile.bin + index 37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9..58dc31a9e2f40f74ff3b45903f7d620b8e5b7356 + GIT binary patch + literal 594 + zc$@)J0W$NUkd + zX$nnYLt$-$V!?uy+1V%`z&Eh=ah|duER<4|QWhju3gb^nF*8iYobxWG-qqXl=2~5M + z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT + zLdYlXB*ODN003Z&P17_@)3Pi=i0wb04