log: fixes line wrap on diffstat (issue5800)
ClosedPublic

Authored by navaneeth.suresh on Dec 27 2018, 6:48 AM.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
yuja added a subscriber: yuja.Dec 30 2018, 3:58 AM
  • return max(i * graphwidth maxtotal, int(bool(i))) + return max(i * graphwidth max(diffstatsum(stats)), int(bool(i)))

Doesn't look correct. Why taking max of
(maxname, maxtotal, totaladds, totalremoves, hasbinary)?

IIUC, the problem is that the width parameter is incorrect because of
graph lines.

IIUC, the problem is that the width parameter is incorrect because of
graph lines.

Thanks for the insight Yuya! I guess my current revision addresses what you meant by abusing graphwidth

yuja added a comment.Jan 1 2019, 10:52 PM

Looks generally good.

Can you add some tests with/without the -T option? There are two callers of
_showpatch().

+ graphwidth = props.get('graphwidth')
+ if not graphwidth:
+ graphwidth = 0

Nit: can be written as props.get('graphwidth', 0).

@yuja Requested changes have been made in the current revision.

yuja added a comment.Jan 3 2019, 4:27 AM

Queued, thanks.

def diffordiffstat(ui, repo, diffopts, node1, node2, match,
  • changes=None, stat=False, fp=None, prefix='',
  • root='', listsubrepos=False, hunksfilterfn=None): + changes=None, stat=False, graphwidth=0, fp=None,

Reordered arguments to fix mq failure. Next time, please run all tests.

This revision was automatically updated to reflect the committed changes.

Thanks for queuing Yuya!

Reordered arguments to fix mq failure. Next time, please run all tests.

Sure will do. Sorry about that.