~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/send.py

  • Committer: Vincent Ladeuil
  • Date: 2010-04-12 16:54:35 UTC
  • mto: (5148.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5151.
  • Revision ID: v.ladeuil+lp@free.fr-20100412165435-gzdnwuybj9rvddiz
Fix bug #519319 by defaulting to a warning for dirty trees.

* bzrlib/mutabletree.py:
(MutableTree.warn_if_changed_or_out_of_date): Factor out the
checks done by send, push and dpush.

* bzrlib/send.py:
(send): Use warn_if_changed_or_out_of_date().

* bzrlib/foreign.py:
(cmd_dpush.run): Use warn_if_changed_or_out_of_date().

* bzrlib/builtins.py:
(cmd_push.run): Use warn_if_changed_or_out_of_date().

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
            if len(revision) == 2:
111
111
                base_revision_id = revision[0].as_revision_id(branch)
112
112
        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.')
 
113
            if tree is not None:
 
114
                tree.warn_if_changed_or_out_of_date(
 
115
                    strict, 'send_strict', 'Use --no-strict to force the send.')
127
116
            revision_id = branch.last_revision()
128
117
        if revision_id == NULL_REVISION:
129
118
            raise errors.BzrCommandError('No revisions to submit.')