~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/reconfigure.py

  • Committer: Vincent Ladeuil
  • Date: 2009-07-02 13:07:14 UTC
  • mto: (4524.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4525.
  • Revision ID: v.ladeuil+lp@free.fr-20090702130714-hsyqfusi8vn3a11m
Use tree.has_changes() where appropriate (the test suite caught a
bug in has_changes() (not filtering out the root) in an impressive
number of tests)

* bzrlib/send.py:
(send): Use tree.has_changes() instead of tree.changes_from().

* bzrlib/reconfigure.py:
(Reconfigure._check): Use tree.has_changes() instead of
tree.changes_from().

* bzrlib/merge.py:
(Merger.ensure_revision_trees, Merger.compare_basis): Use
tree.has_changes() instead of tree.changes_from().

* bzrlib/builtins.py:
(cmd_remove_tree.run, cmd_push.run, cmd_merge.run): Use
tree.has_changes() instead of tree.changes_from().

Show diffs side-by-side

added added

removed removed

Lines of Context:
217
217
    def _check(self):
218
218
        """Raise if reconfiguration would destroy local changes"""
219
219
        if self._destroy_tree:
220
 
            changes = self.tree.changes_from(self.tree.basis_tree())
221
 
            if changes.has_changed():
 
220
            # XXX: What about pending merges ? -- vila 20090629
 
221
            if self.tree.has_changes(self.tree.basis_tree()):
222
222
                raise errors.UncommittedChanges(self.tree)
223
223
        if self._create_reference and self.local_branch is not None:
224
224
            reference_branch = branch.Branch.open(self._select_bind_location())