~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/breakin.py

terminal_width can now returns None.

* bzrlib/win32utils.py:
(get_console_size): Fix typo in comment.

* bzrlib/ui/text.py:
(TextProgressView._show_line): Handle the no terminal present case.

* bzrlib/tests/test_osutils.py:
(TestTerminalWidth): Update tests.

* bzrlib/tests/blackbox/test_too_much.py:
Fix some imports.
(OldTests.test_bzr): Handle the no terminal present case.

* bzrlib/tests/__init__.py:
(VerboseTestResult.report_test_start): Handle the no terminal
present case.

* bzrlib/status.py:
(show_pending_merges): Handle the no terminal present case.
(show_pending_merges.show_log_message): Factor out some
code. Handle the no terminal present case.

* bzrlib/osutils.py:
(terminal_width): Return None if no precise value can be found.

* bzrlib/log.py:
(LineLogFormatter.__init__): Handle the no terminal present case.
(LineLogFormatter.truncate): Accept None as max_len meaning no
truncation.
(LineLogFormatter.log_string): 

* bzrlib/help.py:
(_help_commands_to_text): Handle the no terminal present case.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 2009 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
41
41
        signal.signal(_breakin_signal_number, _debug)
42
42
 
43
43
 
 
44
def hook_sigquit():
 
45
    # We import this late because breakin.py is loaded as part of the main
 
46
    # 'bzr' script, so we want it to load as little as possible until things
 
47
    # are up and running
 
48
    from bzrlib import symbol_versioning, trace
 
49
    trace.mutter_callsite(2, 'Deprecated function called')
 
50
    symbol_versioning.warn(symbol_versioning.deprecation_string(
 
51
        hook_sigquit, symbol_versioning.deprecated_in((1, 18, 0))),
 
52
        DeprecationWarning, stacklevel=2)
 
53
 
 
54
    return hook_debugger_to_signal()
 
55
 
 
56
 
44
57
def determine_signal():
45
58
    global _breakin_signal_number
46
59
    global _breakin_signal_name
65
78
def hook_debugger_to_signal():
66
79
    """Add a signal handler so we drop into the debugger.
67
80
 
68
 
    On Unix, this is hooked into SIGQUIT (C-\\), and on Windows, this is
 
81
    On Linux and Mac, this is hooked into SIGQUIT (C-\\) on Windows, this is
69
82
    hooked into SIGBREAK (C-Pause).
70
83
    """
71
84