Rev 5573: Merge bzr.dev 5598 for NEWS/bzr-2.3.txt in http://bazaar.launchpad.net/~jameinel/bzr/2.3-commit-to-stacked
John Arbash Meinel
john at arbash-meinel.com
Wed Jan 12 15:50:28 UTC 2011
At http://bazaar.launchpad.net/~jameinel/bzr/2.3-commit-to-stacked
------------------------------------------------------------
revno: 5573 [merge]
revision-id: john at arbash-meinel.com-20110112155012-i8gi0bwj9krnjyxu
parent: john at arbash-meinel.com-20110112010153-op19823r9e6hy7u6
parent: pqm at pqm.ubuntu.com-20110112013446-le2folid2nfkgncn
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.3-commit-to-stacked
timestamp: Wed 2011-01-12 09:50:12 -0600
message:
Merge bzr.dev 5598 for NEWS/bzr-2.3.txt
modified:
bzrlib/osutils.py osutils.py-20050309040759-eeaff12fbf77ac86
bzrlib/tests/blackbox/test_help.py test_help.py-20060216004358-4ee8a2a338f75a62
bzrlib/tests/test_osutils.py test_osutils.py-20051201224856-e48ee24c12182989
doc/en/release-notes/bzr-2.3.txt NEWS-20050323055033-4e00b5db738777ff
-------------- next part --------------
=== modified file 'bzrlib/osutils.py'
--- a/bzrlib/osutils.py 2011-01-11 20:20:13 +0000
+++ b/bzrlib/osutils.py 2011-01-12 00:58:05 +0000
@@ -1461,10 +1461,16 @@
# a similar effect.
# If BZR_COLUMNS is set, take it, user is always right
+ # Except if they specified 0 in which case, impose no limit here
try:
- return int(os.environ['BZR_COLUMNS'])
+ width = int(os.environ['BZR_COLUMNS'])
except (KeyError, ValueError):
- pass
+ width = None
+ if width is not None:
+ if width > 0:
+ return width
+ else:
+ return None
isatty = getattr(sys.stdout, 'isatty', None)
if isatty is None or not isatty():
=== modified file 'bzrlib/tests/blackbox/test_help.py'
--- a/bzrlib/tests/blackbox/test_help.py 2010-08-29 14:32:45 +0000
+++ b/bzrlib/tests/blackbox/test_help.py 2011-01-12 00:58:05 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2006, 2007, 2009, 2010 Canonical Ltd
+# Copyright (C) 2006, 2007, 2009, 2010, 2011 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -104,6 +104,10 @@
self.assertEquals(dash_help, qmark_long)
self.assertEquals(dash_help, qmark_cmds)
+ def test_help_width_zero(self):
+ self.overrideEnv('BZR_COLUMNS', '0')
+ self.run_bzr('help commands')
+
def test_hidden(self):
help_commands = self.run_bzr('help commands')[0]
help_hidden = self.run_bzr('help hidden-commands')[0]
=== modified file 'bzrlib/tests/test_osutils.py'
--- a/bzrlib/tests/test_osutils.py 2011-01-10 22:20:12 +0000
+++ b/bzrlib/tests/test_osutils.py 2011-01-12 15:50:12 +0000
@@ -1988,6 +1988,10 @@
self.overrideEnv('BZR_COLUMNS', '12')
self.assertEqual(12, osutils.terminal_width())
+ def test_BZR_COLUMNS_0_no_limit(self):
+ self.overrideEnv('BZR_COLUMNS', '0')
+ self.assertEqual(None, osutils.terminal_width())
+
def test_falls_back_to_COLUMNS(self):
self.overrideEnv('BZR_COLUMNS', None)
self.assertNotEqual('42', os.environ['COLUMNS'])
=== modified file 'doc/en/release-notes/bzr-2.3.txt'
--- a/doc/en/release-notes/bzr-2.3.txt 2011-01-12 01:01:53 +0000
+++ b/doc/en/release-notes/bzr-2.3.txt 2011-01-12 15:50:12 +0000
@@ -74,6 +74,9 @@
been recommended since 2007. The file itself will be removed in the next
release. (John Arbash Meinel)
+* The BZR_COLUMNS environment variable can be set to 0 to indicate no
+ limitation on the width of the terminal. (Neil Martinsen-Burrell, #675652)
+
* You are now able to commit directly to a stacked branch. Any needed
parent inventories will be filled in as part of the commit process.
(John Arbash Meinel, #375013)
More information about the bazaar-commits
mailing list