~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Vincent Ladeuil
  • Date: 2009-07-10 08:33:11 UTC
  • mfrom: (4503.1.3 tree-has-changes)
  • mto: This revision was merged to the branch mainline in revision 4525.
  • Revision ID: v.ladeuil+lp@free.fr-20090710083311-ulnr2ic6lvevjr3a
Quicker check for changes in mutable trees

Show diffs side-by-side

added added

removed removed

Lines of Context:
449
449
        except errors.NoWorkingTree:
450
450
            raise errors.BzrCommandError("No working tree to remove")
451
451
        except errors.NotLocalUrl:
452
 
            raise errors.BzrCommandError("You cannot remove the working tree of a "
453
 
                                         "remote path")
 
452
            raise errors.BzrCommandError("You cannot remove the working tree"
 
453
                                         " of a remote path")
454
454
        if not force:
455
 
            changes = working.changes_from(working.basis_tree())
456
 
            if changes.has_changed():
 
455
            # XXX: What about pending merges ? -- vila 20090629
 
456
            if working.has_changes(working.basis_tree()):
457
457
                raise errors.UncommittedChanges(working)
458
458
 
459
459
        working_path = working.bzrdir.root_transport.base
460
460
        branch_path = working.branch.bzrdir.root_transport.base
461
461
        if working_path != branch_path:
462
 
            raise errors.BzrCommandError("You cannot remove the working tree from "
463
 
                                         "a lightweight checkout")
 
462
            raise errors.BzrCommandError("You cannot remove the working tree"
 
463
                                         " from a lightweight checkout")
464
464
 
465
465
        d.destroy_workingtree()
466
466
 
1114
1114
            revision_id = None
1115
1115
        if (tree is not None and revision_id is None
1116
1116
            and (strict is None or strict)): # Default to True:
1117
 
            changes = tree.changes_from(tree.basis_tree())
1118
 
            if changes.has_changed() or len(tree.get_parent_ids()) > 1:
 
1117
            if (tree.has_changes(tree.basis_tree())
 
1118
                 or len(tree.get_parent_ids()) > 1):
1119
1119
                raise errors.UncommittedChanges(
1120
1120
                    tree, more='Use --no-strict to force the push.')
1121
1121
            if tree.last_revision() != tree.branch.last_revision():
3641
3641
        except errors.NoSuchRevision:
3642
3642
            basis_tree = tree.basis_tree()
3643
3643
        if not force:
3644
 
            changes = tree.changes_from(basis_tree)
3645
 
            if changes.has_changed():
 
3644
            if tree.has_changes(basis_tree):
3646
3645
                raise errors.UncommittedChanges(tree)
3647
3646
 
3648
3647
        view_info = _get_view_info_for_change_reporter(tree)