~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Aaron Bentley
  • Date: 2005-10-13 21:29:09 UTC
  • mfrom: (1451)
  • mto: (1185.25.1)
  • mto: This revision was merged to the branch mainline in revision 1460.
  • Revision ID: abentley@troll-20051013212909-cfde7d2d05ccd47e
Merged latest from robert collins

Show diffs side-by-side

added added

removed removed

Lines of Context:
179
179
    get added when you add a file in the directory.
180
180
    """
181
181
    takes_args = ['file*']
182
 
    takes_options = ['verbose', 'no-recurse']
 
182
    takes_options = ['no-recurse', 'quiet']
183
183
    
184
 
    def run(self, file_list, verbose=False, no_recurse=False):
185
 
        # verbose currently has no effect
186
 
        from bzrlib.add import smart_add, add_reporter_print
187
 
        smart_add(file_list, not no_recurse, add_reporter_print)
188
 
 
 
184
    def run(self, file_list, no_recurse=False, quiet=False):
 
185
        from bzrlib.add import smart_add, add_reporter_print, add_reporter_null
 
186
        if quiet:
 
187
            reporter = add_reporter_null
 
188
        else:
 
189
            reporter = add_reporter_print
 
190
        smart_add(file_list, not no_recurse, reporter)
189
191
 
190
192
 
191
193
class cmd_mkdir(Command):
462
464
    
463
465
    def run(self, branch=None):
464
466
        import info
465
 
 
466
467
        b = Branch.open_containing(branch)
467
468
        info.show_info(b)
468
469
 
1051
1052
    detect data corruption or bzr bugs.
1052
1053
    """
1053
1054
    takes_args = ['dir?']
 
1055
    takes_options = ['verbose']
1054
1056
 
1055
 
    def run(self, dir='.'):
 
1057
    def run(self, dir='.', verbose=False):
1056
1058
        from bzrlib.check import check
1057
 
 
1058
 
        check(Branch.open_containing(dir))
 
1059
        check(Branch.open_containing(dir), verbose)
1059
1060
 
1060
1061
 
1061
1062
class cmd_scan_cache(Command):
1105
1106
            b = None
1106
1107
        
1107
1108
        if email:
1108
 
            print bzrlib.osutils.user_email(b)
 
1109
            print bzrlib.config.user_email(b)
1109
1110
        else:
1110
 
            print bzrlib.osutils.username(b)
 
1111
            print bzrlib.config.username(b)
1111
1112
 
1112
1113
 
1113
1114
class cmd_selftest(Command):
1122
1123
    which tests should run."""
1123
1124
    # TODO: --list should give a list of all available tests
1124
1125
    hidden = True
1125
 
    takes_args = ['testnames*']
1126
 
    takes_options = ['verbose', 'pattern']
1127
 
    def run(self, testnames_list=None, verbose=False, pattern=".*"):
 
1126
    takes_args = ['testspecs*']
 
1127
    takes_options = ['verbose']
 
1128
    def run(self, testspecs_list=None, verbose=False):
1128
1129
        import bzrlib.ui
1129
1130
        from bzrlib.selftest import selftest
1130
1131
        # we don't want progress meters from the tests to go to the
1134
1135
        bzrlib.trace.info('running tests...')
1135
1136
        try:
1136
1137
            bzrlib.ui.ui_factory = bzrlib.ui.SilentUIFactory()
 
1138
            if testspecs_list is not None:
 
1139
                pattern = '|'.join(testspecs_list)
 
1140
            else:
 
1141
                pattern = ".*"
1137
1142
            result = selftest(verbose=verbose, 
1138
 
                              pattern=pattern,
1139
 
                              testnames=testnames_list)
 
1143
                              pattern=pattern)
1140
1144
            if result:
1141
1145
                bzrlib.trace.info('tests passed')
1142
1146
            else: