Rev 6445: (vila) Support scripts that don't call bzrlib.initialize() but still call in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/2.5/

Patch Queue Manager pqm at pqm.ubuntu.com
Thu Jan 19 11:54:39 UTC 2012


At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/2.5/

------------------------------------------------------------
revno: 6445 [merge]
revision-id: pqm at pqm.ubuntu.com-20120119115439-3f3x594uv515t86n
parent: pqm at pqm.ubuntu.com-20120118111041-ycipd0shpm4kbtsl
parent: v.ladeuil+lp at free.fr-20120119112633-528itqkn1vot006v
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: 2.5
timestamp: Thu 2012-01-19 11:54:39 +0000
message:
  (vila) Support scripts that don't call bzrlib.initialize() but still call
   run_bzr() (Vincent Ladeuil)
modified:
  bzrlib/commands.py             bzr.py-20050309040720-d10f4714595cf8c3
  doc/en/release-notes/bzr-2.5.txt bzr2.5.txt-20110708125756-587p0hpw7oke4h05-1
=== modified file 'bzrlib/commands.py'
--- a/bzrlib/commands.py	2011-12-18 12:46:49 +0000
+++ b/bzrlib/commands.py	2012-01-19 11:26:33 +0000
@@ -1071,7 +1071,13 @@
             argv_copy.append(a)
         i += 1
 
-    bzrlib.global_state.cmdline_overrides._from_cmdline(override_config)
+    if bzrlib.global_state is None:
+        # FIXME: Workaround for users that imported bzrlib but didn't call
+        # bzrlib.initialize -- vila 2012-01-19
+        cmdline_overrides = config.CommandLineStore()
+    else:
+        cmdline_overrides = bzrlib.global_state.cmdline_overrides
+    cmdline_overrides._from_cmdline(override_config)
 
     debug.set_debug_flags_from_config()
 
@@ -1131,7 +1137,7 @@
             trace.debug_memory('Process status after command:', short=False)
         option._verbosity_level = saved_verbosity_level
         # Reset the overrides 
-        bzrlib.global_state.cmdline_overrides._reset()
+        cmdline_overrides._reset()
 
 
 def display_command(func):

=== modified file 'doc/en/release-notes/bzr-2.5.txt'
--- a/doc/en/release-notes/bzr-2.5.txt	2012-01-18 10:42:07 +0000
+++ b/doc/en/release-notes/bzr-2.5.txt	2012-01-19 10:28:11 +0000
@@ -32,6 +32,9 @@
 .. Fixes for situations where bzr would previously crash or give incorrect
    or undesirable results.
 
+* Support scripts that don't call bzrlib.initialize() but still call run_bzr().
+  (Vincent Ladeuil, #917733)
+
 * Test for equality instead of object identity where ROOT_PARENT is concerned.
   (Wouter van Heyst, #881142)
 




More information about the bazaar-commits mailing list