/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

MergeĀ lp:bzr.

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
 
            # XXX: What about pending merges ? -- vila 20090629
465
 
            if working.has_changes(working.basis_tree()):
 
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,
3340
3339
    Tests that need working space on disk use a common temporary directory,
3341
3340
    typically inside $TMPDIR or /tmp.
3342
3341
 
 
3342
    If you set BZR_TEST_PDB=1 when running selftest, failing tests will drop
 
3343
    into a pdb postmortem session.
 
3344
 
3343
3345
    :Examples:
3344
3346
        Run only tests relating to 'ignore'::
3345
3347
 
3382
3384
                     Option('lsprof-timed',
3383
3385
                            help='Generate lsprof output for benchmarked'
3384
3386
                                 ' sections of code.'),
 
3387
                     Option('lsprof-tests',
 
3388
                            help='Generate lsprof output for each test.'),
3385
3389
                     Option('cache-dir', type=str,
3386
3390
                            help='Cache intermediate benchmark output in this '
3387
3391
                                 'directory.'),
3428
3432
            first=False, list_only=False,
3429
3433
            randomize=None, exclude=None, strict=False,
3430
3434
            load_list=None, debugflag=None, starting_with=None, subunit=False,
3431
 
            parallel=None):
 
3435
            parallel=None, lsprof_tests=False):
3432
3436
        from bzrlib.tests import selftest
3433
3437
        import bzrlib.benchmarks as benchmarks
3434
3438
        from bzrlib.benchmarks import tree_creator
3468
3472
                              "transport": transport,
3469
3473
                              "test_suite_factory": test_suite_factory,
3470
3474
                              "lsprof_timed": lsprof_timed,
 
3475
                              "lsprof_tests": lsprof_tests,
3471
3476
                              "bench_history": benchfile,
3472
3477
                              "matching_tests_first": first,
3473
3478
                              "list_only": list_only,
3650
3655
        verified = 'inapplicable'
3651
3656
        tree = WorkingTree.open_containing(directory)[0]
3652
3657
 
3653
 
        # die as quickly as possible if there are uncommitted changes
3654
3658
        try:
3655
3659
            basis_tree = tree.revision_tree(tree.last_revision())
3656
3660
        except errors.NoSuchRevision:
3657
3661
            basis_tree = tree.basis_tree()
 
3662
 
 
3663
        # die as quickly as possible if there are uncommitted changes
3658
3664
        if not force:
3659
 
            if tree.has_changes(basis_tree):
 
3665
            if tree.has_changes():
3660
3666
                raise errors.UncommittedChanges(tree)
3661
3667
 
3662
3668
        view_info = _get_view_info_for_change_reporter(tree)
3713
3719
                                       merger.other_rev_id)
3714
3720
                    result.report(self.outf)
3715
3721
                    return 0
3716
 
            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')")
3717
3726
            if preview:
3718
3727
                return self._do_preview(merger, cleanups)
3719
3728
            elif interactive:
4962
4971
 
4963
4972
    To use a specific mail program, set the mail_client configuration option.
4964
4973
    (For Thunderbird 1.5, this works around some bugs.)  Supported values for
4965
 
    specific clients are "claws", "evolution", "kmail", "mutt", and
4966
 
    "thunderbird"; generic options are "default", "editor", "emacsclient",
4967
 
    "mapi", and "xdg-email".  Plugins may also add supported clients.
 
4974
    specific clients are "claws", "evolution", "kmail", "mail.app" (MacOS X's
 
4975
    Mail.app), "mutt", and "thunderbird"; generic options are "default",
 
4976
    "editor", "emacsclient", "mapi", and "xdg-email".  Plugins may also add
 
4977
    supported clients.
4968
4978
 
4969
4979
    If mail is being sent, a to address is required.  This can be supplied
4970
4980
    either on the commandline, by setting the submit_to configuration