/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

  • Committer: Robert Collins
  • Date: 2009-08-25 19:29:41 UTC
  • mfrom: (4648 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4649.
  • Revision ID: robertc@robertcollins.net-20090825192941-x2kg9ikhsapjbs7b
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
603
603
    branches that will be merged later (without showing the two different
604
604
    adds as a conflict). It is also useful when merging another project
605
605
    into a subdirectory of this one.
 
606
    
 
607
    Any files matching patterns in the ignore list will not be added
 
608
    unless they are explicitly mentioned.
606
609
    """
607
610
    takes_args = ['file*']
608
611
    takes_options = [
616
619
               help='Lookup file ids from this tree.'),
617
620
        ]
618
621
    encoding_type = 'replace'
619
 
    _see_also = ['remove']
 
622
    _see_also = ['remove', 'ignore']
620
623
 
621
624
    def run(self, file_list, no_recurse=False, dry_run=False, verbose=False,
622
625
            file_ids_from=None):
654
657
                    for path in ignored[glob]:
655
658
                        self.outf.write("ignored %s matching \"%s\"\n"
656
659
                                        % (path, glob))
657
 
            else:
658
 
                match_len = 0
659
 
                for glob, paths in ignored.items():
660
 
                    match_len += len(paths)
661
 
                self.outf.write("ignored %d file(s).\n" % match_len)
662
 
            self.outf.write("If you wish to add ignored files, "
663
 
                            "please add them explicitly by name. "
664
 
                            "(\"bzr ignored\" gives a list)\n")
665
660
 
666
661
 
667
662
class cmd_mkdir(Command):
1172
1167
        help='Hard-link working tree files where possible.'),
1173
1168
        Option('no-tree',
1174
1169
            help="Create a branch without a working-tree."),
 
1170
        Option('switch',
 
1171
            help="Switch the checkout in the current directory "
 
1172
                 "to the new branch."),
1175
1173
        Option('stacked',
1176
1174
            help='Create a stacked branch referring to the source branch. '
1177
1175
                'The new branch will depend on the availability of the source '
1188
1186
 
1189
1187
    def run(self, from_location, to_location=None, revision=None,
1190
1188
            hardlink=False, stacked=False, standalone=False, no_tree=False,
1191
 
            use_existing_dir=False):
 
1189
            use_existing_dir=False, switch=False):
 
1190
        from bzrlib import switch as _mod_switch
1192
1191
        from bzrlib.tag import _merge_tags_if_possible
1193
 
 
1194
1192
        accelerator_tree, br_from = bzrdir.BzrDir.open_tree_or_branch(
1195
1193
            from_location)
1196
1194
        if (accelerator_tree is not None and
1250
1248
            except (errors.NotStacked, errors.UnstackableBranchFormat,
1251
1249
                errors.UnstackableRepositoryFormat), e:
1252
1250
                note('Branched %d revision(s).' % branch.revno())
 
1251
            if switch:
 
1252
                # Switch to the new branch
 
1253
                wt, _ = WorkingTree.open_containing('.')
 
1254
                _mod_switch.switch(wt.bzrdir, branch)
 
1255
                note('Switched to branch: %s',
 
1256
                    urlutils.unescape_for_display(branch.base, 'utf-8'))
1253
1257
        finally:
1254
1258
            br_from.unlock()
1255
1259
 
3365
3369
                     Option('lsprof-timed',
3366
3370
                            help='Generate lsprof output for benchmarked'
3367
3371
                                 ' sections of code.'),
 
3372
                     Option('lsprof-tests',
 
3373
                            help='Generate lsprof output for each test.'),
3368
3374
                     Option('cache-dir', type=str,
3369
3375
                            help='Cache intermediate benchmark output in this '
3370
3376
                                 'directory.'),
3411
3417
            first=False, list_only=False,
3412
3418
            randomize=None, exclude=None, strict=False,
3413
3419
            load_list=None, debugflag=None, starting_with=None, subunit=False,
3414
 
            parallel=None):
 
3420
            parallel=None, lsprof_tests=False):
3415
3421
        from bzrlib.tests import selftest
3416
3422
        import bzrlib.benchmarks as benchmarks
3417
3423
        from bzrlib.benchmarks import tree_creator
3451
3457
                              "transport": transport,
3452
3458
                              "test_suite_factory": test_suite_factory,
3453
3459
                              "lsprof_timed": lsprof_timed,
 
3460
                              "lsprof_tests": lsprof_tests,
3454
3461
                              "bench_history": benchfile,
3455
3462
                              "matching_tests_first": first,
3456
3463
                              "list_only": list_only,