[PATCH] diffstat: use ui.plain() instead of ui.interactive()
Dan Villiom Podlaski Christiansen
danchr at gmail.com
Thu Apr 15 11:53:34 CDT 2010
# HG changeset patch
# User Dan Villiom Podlaski Christiansen <danchr at gmail.com>
# Date 1271350379 -7200
# Node ID 75444eb1d063712c6f5624709eaa5dae8c05e1f5
# Parent aa25d7f1f71071d5c5bebb495ce18e563540a1a2
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.
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1176,7 +1176,10 @@ def diff(ui, repo, *pats, **opts):
m = cmdutil.match(repo, pats, opts)
if stat:
it = patch.diff(repo, node1, node2, match=m, opts=diffopts)
- width = ui.interactive() and util.termwidth() or 80
+ if not ui.plain():
+ width = util.termwidth()
+ else:
+ width = 80
for chunk, label in patch.diffstatui(util.iterlines(it), width=width,
git=diffopts.git):
ui.write(chunk, label=label)
More information about the Mercurial-devel
mailing list