/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Vincent Ladeuil
  • Date: 2009-06-30 15:54:23 UTC
  • mto: (4496.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4497.
  • Revision ID: v.ladeuil+lp@free.fr-20090630155423-afousrl3zrdx0he2
Fixed as per jam's review.

* tests/blackbox/test_push.py:
(load_tests): One more changes type.
(TestPushStrictMixin): Switch to using mixin, it's clearer.
Define some default values as attributes so that they can be
changed more easily.
(TestPushStrictMixin.assertPushFails,
TestPushStrictMixin.assertPushSucceeds): Use default values from
attributes.
(TestPushStrictWithChanges._out_of_sync_trees): Setup a new
context and change the default values.

* errors.py:
(OutOfDateTree, UncommittedChanges): Add a more parameter so more
details can be given.

* builtins.py:
(cmd_push.run): Add an additional check that the tree is still in
sync with its branch before pushing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1067
1067
            and (strict is None or strict)): # Default to True:
1068
1068
            changes = tree.changes_from(tree.basis_tree())
1069
1069
            if changes.has_changed() or len(tree.get_parent_ids()) > 1:
1070
 
                raise errors.UncommittedChanges(tree)
 
1070
                raise errors.UncommittedChanges(
 
1071
                    tree, more='Use --no-strict to force the push.')
 
1072
            if tree.last_revision() != tree.branch.last_revision():
 
1073
                # The tree has lost sync with its branch, there is little
 
1074
                # chance that the user is aware of it but he can still force
 
1075
                # the push with --no-strict
 
1076
                raise errors.OutOfDateTree(
 
1077
                    tree, more='Use --no-strict to force the push.')
1071
1078
 
1072
1079
        # Get the stacked_on branch, if any
1073
1080
        if stacked_on is not None: