diffstat: use ui.plain() instead of ui.interactive()

Previously, a default width of 80 is used for non-interactive
sessions. This behaviour was introduced before HGPLAIN was supported.
This commit is contained in:
Dan Villiom Podlaski Christiansen 2010-04-15 18:52:59 +02:00
parent eb02fcecf2
commit b9377254d9

View File

@ -1158,7 +1158,9 @@ def diff(ui, repo, *pats, **opts):
m = cmdutil.match(repo, pats, opts)
it = patch.diff(repo, node1, node2, match=m, opts=diffopts)
if stat:
width = ui.interactive() and util.termwidth() or 80
width = 80
if not ui.plain():
width = util.termwidth()
ui.write(patch.diffstat(util.iterlines(it), width=width,
git=diffopts.git))
else: