/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 bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
747
747
            # The destination doesn't exist; create it.
748
748
            # XXX: Refactor the create_prefix/no_create_prefix code into a
749
749
            #      common helper function
 
750
 
 
751
            def make_directory(transport):
 
752
                transport.mkdir('.')
 
753
                return transport
 
754
 
 
755
            def redirected(redirected_transport, e, redirection_notice):
 
756
                return transport.get_transport(e.get_target_url())
 
757
 
750
758
            try:
751
 
                to_transport.mkdir('.')
 
759
                to_transport = transport.do_catching_redirections(
 
760
                    make_directory, to_transport, redirected)
752
761
            except errors.FileExists:
753
762
                if not use_existing_dir:
754
763
                    raise errors.BzrCommandError("Target directory %s"
763
772
                        " leading parent directories."
764
773
                        % location)
765
774
                _create_prefix(to_transport)
 
775
            except errors.TooManyRedirections:
 
776
                raise errors.BzrCommandError("Too many redirections trying "
 
777
                                             "to make %s." % location)
766
778
 
767
779
            # Now the target directory exists, but doesn't have a .bzr
768
780
            # directory. So we need to create it, along with any work to create
2114
2126
    def run(self, filename, revision=None, name_from_revision=False):
2115
2127
        if revision is not None and len(revision) != 1:
2116
2128
            raise errors.BzrCommandError("bzr cat --revision takes exactly"
2117
 
                                        " one number")
2118
 
        tree = None
2119
 
        try:
2120
 
            tree, b, relpath = \
2121
 
                    bzrdir.BzrDir.open_containing_tree_or_branch(filename)
2122
 
        except errors.NotBranchError:
2123
 
            pass
2124
 
 
2125
 
        if revision is not None and revision[0].get_branch() is not None:
2126
 
            b = Branch.open(revision[0].get_branch())
2127
 
        b.lock_read()
2128
 
        try:
2129
 
            return self._run(tree, b, relpath, filename, revision,
2130
 
                name_from_revision)
 
2129
                                         " one revision specifier")
 
2130
        tree, branch, relpath = \
 
2131
            bzrdir.BzrDir.open_containing_tree_or_branch(filename)
 
2132
        branch.lock_read()
 
2133
        try:
 
2134
            return self._run(tree, branch, relpath, filename, revision,
 
2135
                             name_from_revision)
2131
2136
        finally:
2132
 
            b.unlock()
 
2137
            branch.unlock()
2133
2138
 
2134
2139
    def _run(self, tree, b, relpath, filename, revision, name_from_revision):
2135
2140
        if tree is None:
2599
2604
                                 ' expression.'),
2600
2605
                     Option('strict', help='Fail on missing dependencies or '
2601
2606
                            'known failures.'),
 
2607
                     Option('coverage', type=str, argname="DIRECTORY",
 
2608
                            help='Generate line coverage report in this'
 
2609
                                 'directory.'),
2602
2610
                     ]
2603
2611
    encoding_type = 'replace'
2604
2612
 
2606
2614
            transport=None, benchmark=None,
2607
2615
            lsprof_timed=None, cache_dir=None,
2608
2616
            first=False, list_only=False,
2609
 
            randomize=None, exclude=None, strict=False):
 
2617
            randomize=None, exclude=None, strict=False, coverage=None):
2610
2618
        import bzrlib.ui
2611
2619
        from bzrlib.tests import selftest
2612
2620
        import bzrlib.benchmarks as benchmarks
2648
2656
                              random_seed=randomize,
2649
2657
                              exclude_pattern=exclude,
2650
2658
                              strict=strict,
 
2659
                              coverage_dir=coverage,
2651
2660
                              )
2652
2661
        finally:
2653
2662
            if benchfile is not None:
3957
3966
    for that mirror.
3958
3967
 
3959
3968
    Mail is sent using your preferred mail program.  This should be transparent
3960
 
    on Windows (it uses MAPI).  On *nix, it requires the xdg-email utility.  If
3961
 
    the preferred client can't be found (or used), your editor will be used.
 
3969
    on Windows (it uses MAPI).  On Linux, it requires the xdg-email utility.
 
3970
    If the preferred client can't be found (or used), your editor will be used.
3962
3971
    
3963
3972
    To use a specific mail program, set the mail_client configuration option.
3964
3973
    (For Thunderbird 1.5, this works around some bugs.)  Supported values for