~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/send.py

  • Committer: Vincent Ladeuil
  • Date: 2009-07-15 07:34:23 UTC
  • mfrom: (4503.2.6 bool-config-option)
  • mto: This revision was merged to the branch mainline in revision 4537.
  • Revision ID: v.ladeuil+lp@free.fr-20090715073423-ri6ms86pfwxfoop8
Support boolean variables in configuration files and UI queries

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
                base_revision_id = revision[0].as_revision_id(branch)
109
109
        if revision_id is None:
110
110
            if strict is None:
111
 
                strict = branch.get_config().get_user_option('send_strict')
112
 
                if strict is not None:
113
 
                    # FIXME: This should be better supported by config
114
 
                    # -- vila 20090626
115
 
                    bools = dict(yes=True, no=False, on=True, off=False,
116
 
                                 true=True, false=False)
117
 
                    try:
118
 
                        strict = bools[strict.lower()]
119
 
                    except KeyError:
120
 
                        strict = None
121
 
            if tree is not None and (strict is None or strict):
 
111
                strict = branch.get_config(
 
112
                    ).get_user_option_as_bool('send_strict')
 
113
            if strict is None: strict = True # default value
 
114
            if strict and tree is not None:
122
115
                if (tree.has_changes(tree.basis_tree())
123
116
                    or len(tree.get_parent_ids()) > 1):
124
117
                    raise errors.UncommittedChanges(