Rev 5232: More NEWS about the bzrlib.initialize contract change, and typographical error fixes for __init__.py. in http://bazaar.launchpad.net/~lifeless/bzr/fix-terminal-spew

Robert Collins robertc at robertcollins.net
Mon Jun 21 05:16:18 BST 2010


At http://bazaar.launchpad.net/~lifeless/bzr/fix-terminal-spew

------------------------------------------------------------
revno: 5232
revision-id: robertc at robertcollins.net-20100621041616-w3unifc8ua57kppc
parent: robertc at robertcollins.net-20100621035508-wrcgnqv227ftxhs8
committer: Robert Collins <robertc at robertcollins.net>
branch nick: fix-terminal-spew
timestamp: Mon 2010-06-21 16:16:16 +1200
message:
  More NEWS about the bzrlib.initialize contract change, and typographical error fixes for __init__.py.
=== modified file 'NEWS'
--- a/NEWS	2010-06-21 01:30:45 +0000
+++ b/NEWS	2010-06-21 04:16:16 +0000
@@ -14,12 +14,19 @@
 Compatibility Breaks
 ********************
 
+* bzrlib library users now need to call ``__enter__`` and ``__exit__`` on
+  the result of ``bzrlib.initialize``. This change was made when fixing
+  the bad habit recent bzr versions have had of leaving progress bars 
+  behind on the screen. That required calling another function before
+  exiting the program, and it made sense to provide a full context
+  manager at the same time. (Robert Collins)
+
 * The ``bzr`` front end now requires a ``bzrlib.ui.ui_factory`` which is a
   context manager in the Python 2.5 and above sense. The bzrlib base class
   is such a manager, but third party UI factories which do not derive from
   ``bzrlib.ui.UIFactory`` will be incompatible with the command line front
-  end. (Robert Collins, Aaron Bentley)
-
+  end.
+  
 * URLs like ``foo:bar/baz`` are now always parsed as a URL with scheme "foo"
   and path "bar/baz", even if bzr does not recognize "foo" as a known URL
   scheme.  Previously these URLs would be treated as local paths.

=== modified file 'bzrlib/__init__.py'
--- a/bzrlib/__init__.py	2010-06-21 03:55:08 +0000
+++ b/bzrlib/__init__.py	2010-06-21 04:16:16 +0000
@@ -137,7 +137,7 @@
 # context of an operation than to look it up directly, but when that is too
 # hard, it is better to use this variable than to make a branch new global
 # variable.
-# If using this variable my looking it up (because it can't be easily obtained)
+# If using this variable by looking it up (because it can't be easily obtained)
 # it is important to store the reference you get, rather than looking it up
 # repeatedly; that way your code will behave properly in the bzrlib test suite
 # and from programs that do use multiple library contexts.
@@ -232,7 +232,7 @@
     :param stdin, stdout, stderr: If provided, use these for terminal IO;
         otherwise use the files in `sys`.
     :return: A context manager for the use of bzrlib. The __enter__ method of
-        this context needs to be alled before it takes effect, and the __exit__
+        this context needs to be called before it takes effect, and the __exit__
         should be called by the caller before exiting their process or
         otherwise stopping use of bzrlib. Advanced callers can use
         BzrLibraryState directly.




More information about the bazaar-commits mailing list