~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/send.py

  • Committer: Martin von Gagern
  • Date: 2011-09-06 18:37:06 UTC
  • mto: This revision was merged to the branch mainline in revision 6125.
  • Revision ID: martin.vgagern@gmx.net-20110906183706-urhewu99oiqb6fer
Expose problems with multiple reconfigure requests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
            submit_branch = stored_submit_branch
64
64
            remembered_submit_branch = "submit"
65
65
        else:
66
 
            if stored_submit_branch is None or remember:
 
66
            # Remembers if asked explicitly or no previous location is set
 
67
            if remember or (remember is None and stored_submit_branch is None):
67
68
                branch.set_submit_branch(submit_branch)
68
69
        if submit_branch is None:
69
70
            submit_branch = branch.get_parent()
95
96
        stored_public_branch = branch.get_public_branch()
96
97
        if public_branch is None:
97
98
            public_branch = stored_public_branch
98
 
        elif stored_public_branch is None or remember:
 
99
        # Remembers if asked explicitly or no previous location is set
 
100
        elif (remember
 
101
              or (remember is None and stored_public_branch is None)):
99
102
            branch.set_public_branch(public_branch)
100
103
        if no_bundle and public_branch is None:
101
104
            raise errors.BzrCommandError('No public branch specified or'
110
113
            if len(revision) == 2:
111
114
                base_revision_id = revision[0].as_revision_id(branch)
112
115
        if revision_id is None:
113
 
            if strict is None:
114
 
                strict = branch.get_config(
115
 
                    ).get_user_option_as_bool('send_strict')
116
 
            if strict is None: strict = True # default value
117
 
            if strict and tree is not None:
118
 
                if (tree.has_changes()):
119
 
                    raise errors.UncommittedChanges(
120
 
                        tree, more='Use --no-strict to force the send.')
121
 
                if tree.last_revision() != tree.branch.last_revision():
122
 
                    # The tree has lost sync with its branch, there is little
123
 
                    # chance that the user is aware of it but he can still force
124
 
                    # the send with --no-strict
125
 
                    raise errors.OutOfDateTree(
126
 
                        tree, more='Use --no-strict to force the send.')
 
116
            if tree is not None:
 
117
                tree.check_changed_or_out_of_date(
 
118
                    strict, 'send_strict',
 
119
                    more_error='Use --no-strict to force the send.',
 
120
                    more_warning='Uncommitted changes will not be sent.')
127
121
            revision_id = branch.last_revision()
128
122
        if revision_id == NULL_REVISION:
129
123
            raise errors.BzrCommandError('No revisions to submit.')