~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

[merge] config file and other things from robert

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):
1099
1101
            b = None
1100
1102
        
1101
1103
        if email:
1102
 
            print bzrlib.osutils.user_email(b)
 
1104
            print bzrlib.config.user_email(b)
1103
1105
        else:
1104
 
            print bzrlib.osutils.username(b)
 
1106
            print bzrlib.config.username(b)
1105
1107
 
1106
1108
 
1107
1109
class cmd_selftest(Command):
1116
1118
    which tests should run."""
1117
1119
    # TODO: --list should give a list of all available tests
1118
1120
    hidden = True
1119
 
    takes_args = ['testnames*']
1120
 
    takes_options = ['verbose', 'pattern']
1121
 
    def run(self, testnames_list=None, verbose=False, pattern=".*"):
 
1121
    takes_args = ['testspecs*']
 
1122
    takes_options = ['verbose']
 
1123
    def run(self, testspecs_list=None, verbose=False):
1122
1124
        import bzrlib.ui
1123
1125
        from bzrlib.selftest import selftest
1124
1126
        # we don't want progress meters from the tests to go to the
1128
1130
        bzrlib.trace.info('running tests...')
1129
1131
        try:
1130
1132
            bzrlib.ui.ui_factory = bzrlib.ui.SilentUIFactory()
 
1133
            if testspecs_list is not None:
 
1134
                pattern = '|'.join(testspecs_list)
 
1135
            else:
 
1136
                pattern = ".*"
1131
1137
            result = selftest(verbose=verbose, 
1132
 
                              pattern=pattern,
1133
 
                              testnames=testnames_list)
 
1138
                              pattern=pattern)
1134
1139
            if result:
1135
1140
                bzrlib.trace.info('tests passed')
1136
1141
            else: