[PATCH] diffstat: don't try to determine width, use 80 columns always

Alexander Solovyov piranha at piranha.org.ua
Thu Mar 19 15:43:08 CDT 2009


# HG changeset patch
# User Alexander Solovyov <piranha at piranha.org.ua>
# Date 1237495384 -7200
# Node ID b8d28f0824e432e03abf90d7fc87b3da78fc3ef1
# Parent  e945e012d5d10e11d6615dde3e3296cac77faaa9
diffstat: don't try to determine width, use 80 columns always

diff --git a/mercurial/patch.py b/mercurial/patch.py
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -1361,8 +1361,9 @@
 
 def diffstat(lines):
     output = []
+    # that's 80 - 2
+    width = 78
     stats = list(diffstatdata(lines))
-    width = util.termwidth() - 2
 
     maxtotal, maxname = 0, 0
     totaladds, totalremoves = 0, 0
diff --git a/tests/test-patchbomb b/tests/test-patchbomb
--- a/tests/test-patchbomb
+++ b/tests/test-patchbomb
@@ -11,8 +11,6 @@
 echo "[extensions]" >> $HGRCPATH
 echo "patchbomb=" >> $HGRCPATH
 
-COLUMNS=80; export COLUMNS
-
 hg init t
 cd t
 echo a > a


More information about the Mercurial-devel mailing list