/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Neil Martinsen-Burrell
  • Date: 2011-01-10 05:26:56 UTC
  • mto: (5597.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 5598.
  • Revision ID: nmb@wartburg.edu-20110110052656-q89mlw9qjxlqmmd3
allow BZR_COLUMNS to be 0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1461
1461
    # a similar effect.
1462
1462
 
1463
1463
    # If BZR_COLUMNS is set, take it, user is always right
 
1464
    # Except if they specified 0 in which case, impose no limit here
1464
1465
    try:
1465
 
        return int(os.environ['BZR_COLUMNS'])
 
1466
        width = int(os.environ['BZR_COLUMNS'])
1466
1467
    except (KeyError, ValueError):
1467
 
        pass
 
1468
        width = None
 
1469
    if width is not None:
 
1470
        if width > 0:
 
1471
            return width
 
1472
        else:
 
1473
            return None
1468
1474
 
1469
1475
    isatty = getattr(sys.stdout, 'isatty', None)
1470
1476
    if isatty is None or not isatty():