~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

Merge bzr.dev 4734 in preparation for NEWS updates.

Show diffs side-by-side

added added

removed removed

Lines of Context:
461
461
            raise errors.BzrCommandError("You cannot remove the working tree"
462
462
                                         " of a remote path")
463
463
        if not force:
464
 
            if (working.has_changes(working.basis_tree())
465
 
                or len(working.get_parent_ids()) > 1):
 
464
            if (working.has_changes()):
466
465
                raise errors.UncommittedChanges(working)
467
466
 
468
467
        working_path = working.bzrdir.root_transport.base
1109
1108
        else:
1110
1109
            revision_id = None
1111
1110
        if strict and tree is not None and revision_id is None:
1112
 
            if (tree.has_changes(tree.basis_tree())
1113
 
                or len(tree.get_parent_ids()) > 1):
 
1111
            if (tree.has_changes()):
1114
1112
                raise errors.UncommittedChanges(
1115
1113
                    tree, more='Use --no-strict to force the push.')
1116
1114
            if tree.last_revision() != tree.branch.last_revision():
1887
1885
    @display_command
1888
1886
    def run(self, revision=None, file_list=None, diff_options=None,
1889
1887
            prefix=None, old=None, new=None, using=None):
1890
 
        from bzrlib.diff import _get_trees_to_diff, show_diff_trees
 
1888
        from bzrlib.diff import get_trees_and_branches_to_diff, show_diff_trees
1891
1889
 
1892
1890
        if (prefix is None) or (prefix == '0'):
1893
1891
            # diff -p0 format
1907
1905
            raise errors.BzrCommandError('bzr diff --revision takes exactly'
1908
1906
                                         ' one or two revision specifiers')
1909
1907
 
1910
 
        old_tree, new_tree, specific_files, extra_trees = \
1911
 
                _get_trees_to_diff(file_list, revision, old, new,
1912
 
                apply_view=True)
 
1908
        (old_tree, new_tree,
 
1909
         old_branch, new_branch,
 
1910
         specific_files, extra_trees) = get_trees_and_branches_to_diff(
 
1911
            file_list, revision, old, new, apply_view=True)
1913
1912
        return show_diff_trees(old_tree, new_tree, sys.stdout,
1914
1913
                               specific_files=specific_files,
1915
1914
                               external_diff_options=diff_options,
3663
3662
 
3664
3663
        # die as quickly as possible if there are uncommitted changes
3665
3664
        if not force:
3666
 
            if tree.has_changes(basis_tree) or len(tree.get_parent_ids()) > 1:
 
3665
            if tree.has_changes():
3667
3666
                raise errors.UncommittedChanges(tree)
3668
3667
 
3669
3668
        view_info = _get_view_info_for_change_reporter(tree)
3720
3719
                                       merger.other_rev_id)
3721
3720
                    result.report(self.outf)
3722
3721
                    return 0
3723
 
            merger.check_basis(False)
 
3722
            if merger.this_basis is None:
 
3723
                raise errors.BzrCommandError(
 
3724
                    "This branch has no commits."
 
3725
                    " (perhaps you would prefer 'bzr pull')")
3724
3726
            if preview:
3725
3727
                return self._do_preview(merger, cleanups)
3726
3728
            elif interactive: