Rev 4814: (mbp) Register SIGWINCH only when creating a TextUIFactory in file:///home/pqm/archives/thelove/bzr/2.1/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Feb 17 06:58:47 GMT 2010


At file:///home/pqm/archives/thelove/bzr/2.1/

------------------------------------------------------------
revno: 4814 [merge]
revision-id: pqm at pqm.ubuntu.com-20100217065845-lmm1uctm5jlcy8d2
parent: pqm at pqm.ubuntu.com-20100216170405-7ks6r8la72hzcl53
parent: mbp at sourcefrog.net-20100217060154-pe6p5idzqbtvpqby
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: 2.1
timestamp: Wed 2010-02-17 06:58:45 +0000
message:
  (mbp) Register SIGWINCH only when creating a TextUIFactory
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzr                            bzr.py-20050313053754-5485f144c7006fa6
  bzrlib/__init__.py             __init__.py-20050309040759-33e65acf91bbcd5d
  bzrlib/osutils.py              osutils.py-20050309040759-eeaff12fbf77ac86
  bzrlib/ui/text.py              text.py-20051130153916-2e438cffc8afc478
=== modified file 'NEWS'
--- a/NEWS	2010-02-16 16:08:40 +0000
+++ b/NEWS	2010-02-17 06:01:54 +0000
@@ -5,6 +5,20 @@
 .. contents:: List of Releases
    :depth: 1
 
+
+bzr 2.1.1
+#########
+
+:2.1.1: not released yet
+
+Bug Fixes
+*********
+
+* Register SIGWINCH handler only when creating a ``TextUIFactory``; avoids
+  problems importing bzrlib from a non-main thread.
+  (Elliot Murphy, #521989)
+
+
 bzr 2.1.0
 #########
 

=== modified file 'bzr'
--- a/bzr	2009-12-15 19:59:00 +0000
+++ b/bzr	2010-02-17 05:58:10 +0000
@@ -23,7 +23,7 @@
 import warnings
 
 # update this on each release
-_script_version = (2, 1, 0)
+_script_version = (2, 1, 1)
 
 if __doc__ is None:
     print "bzr does not support python -OO."

=== modified file 'bzrlib/__init__.py'
--- a/bzrlib/__init__.py	2010-02-11 23:07:09 +0000
+++ b/bzrlib/__init__.py	2010-02-17 05:58:10 +0000
@@ -44,7 +44,7 @@
 # Python version 2.0 is (2, 0, 0, 'final', 0)."  Additionally we use a
 # releaselevel of 'dev' for unreleased under-development code.
 
-version_info = (2, 1, 0, 'final', 0)
+version_info = (2, 1, 1, 'dev', 0)
 
 # API compatibility version: bzrlib is currently API compatible with 1.15.
 api_minimum_version = (2, 1, 0)

=== modified file 'bzrlib/osutils.py'
--- a/bzrlib/osutils.py	2010-01-13 15:30:22 +0000
+++ b/bzrlib/osutils.py	2010-02-17 06:01:54 +0000
@@ -1438,12 +1438,21 @@
     if width is not None:
         os.environ['COLUMNS'] = str(width)
 
-if sys.platform == 'win32':
-    # Martin (gz) mentioned WINDOW_BUFFER_SIZE_RECORD from ReadConsoleInput but
-    # I've no idea how to plug that in the current design -- vila 20091216
-    pass
-else:
-    signal.signal(signal.SIGWINCH, _terminal_size_changed)
+
+_registered_sigwinch = False
+
+def watch_sigwinch():
+    """Register for SIGWINCH, once and only once."""
+    global _registered_sigwinch
+    if not _registered_sigwinch:
+        if sys.platform == 'win32':
+            # Martin (gz) mentioned WINDOW_BUFFER_SIZE_RECORD from
+            # ReadConsoleInput but I've no idea how to plug that in
+            # the current design -- vila 20091216
+            pass
+        else:
+            signal.signal(signal.SIGWINCH, _terminal_size_changed)
+        _registered_sigwinch = True
 
 
 def supports_executable():

=== modified file 'bzrlib/ui/text.py'
--- a/bzrlib/ui/text.py	2010-01-15 03:29:33 +0000
+++ b/bzrlib/ui/text.py	2010-02-17 06:01:54 +0000
@@ -37,6 +37,8 @@
 
 """)
 
+from bzrlib.osutils import watch_sigwinch
+
 from bzrlib.ui import (
     UIFactory,
     NullProgressView,
@@ -60,7 +62,9 @@
         self.stderr = stderr
         # paints progress, network activity, etc
         self._progress_view = self.make_progress_view()
-        
+        # hook up the signals to watch for terminal size changes
+        watch_sigwinch()
+
     def be_quiet(self, state):
         if state and not self._quiet:
             self.clear_term()




More information about the bazaar-commits mailing list