Rev 4495: Use config.get_user_option_as_bool. in file:///home/vila/src/bzr/experimental/cleanup-strict/

Vincent Ladeuil v.ladeuil+lp at free.fr
Mon Jun 29 15:32:01 BST 2009


At file:///home/vila/src/bzr/experimental/cleanup-strict/

------------------------------------------------------------
revno: 4495
revision-id: v.ladeuil+lp at free.fr-20090629143200-88ovzzhniu60j0c3
parent: v.ladeuil+lp at free.fr-20090629135234-o9yl5hirlss1vg5r
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: cleanup-strict
timestamp: Mon 2009-06-29 16:32:00 +0200
message:
  Use config.get_user_option_as_bool.
  
  * bzrlib/send.py:
  (send): Use get_user_option_as_bool.
  
  * bzrlib/builtins.py:
  (cmd_push.run): Use get_user_option_as_bool.
-------------- next part --------------
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2009-06-29 11:07:16 +0000
+++ b/bzrlib/builtins.py	2009-06-29 14:32:00 +0000
@@ -1047,16 +1047,7 @@
         (tree, br_from,
          _unused) = bzrdir.BzrDir.open_containing_tree_or_branch(directory)
         if strict is None:
-            strict = br_from.get_config().get_user_option('push_strict')
-            if strict is not None:
-                # FIXME: This should be better supported by config
-                # -- vila 20090611
-                bools = dict(yes=True, no=False, on=True, off=False,
-                             true=True, false=False)
-                try:
-                    strict = bools[strict.lower()]
-                except KeyError:
-                    strict = None
+            strict = br_from.get_config().get_user_option_as_bool('push_strict')
         # Get the tip's revision_id
         revision = _get_one_revision('push', revision)
         if revision is not None:

=== modified file 'bzrlib/send.py'
--- a/bzrlib/send.py	2009-06-26 18:13:41 +0000
+++ b/bzrlib/send.py	2009-06-29 14:32:00 +0000
@@ -108,16 +108,8 @@
                 base_revision_id = revision[0].as_revision_id(branch)
         if revision_id is None:
             if strict is None:
-                strict = branch.get_config().get_user_option('send_strict')
-                if strict is not None:
-                    # FIXME: This should be better supported by config
-                    # -- vila 20090626
-                    bools = dict(yes=True, no=False, on=True, off=False,
-                                 true=True, false=False)
-                    try:
-                        strict = bools[strict.lower()]
-                    except KeyError:
-                        strict = None
+                strict = branch.get_config(
+                    ).get_user_option_as_bool('send_strict')
             if strict is None or strict: # Default to True
                 changes = tree.changes_from(tree.basis_tree())
                 if changes.has_changed() or len(tree.get_parent_ids()) > 1:



More information about the bazaar-commits mailing list