~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/check.py

Rework test_script a little bit.


Don't allow someone to request a stdin request to echo.
Echo never reads from stdin, it just echos its arguments.
You use 'cat' if you want to read from stdin.

A few other fixes because the tests were using filenames
that are actually illegal on Windows, rather than just
nonexistant.


Change the exception handling for commands so that
unknown errors don't get silently squashed and then
turn into hard-to-debug errors later.

test_script now passes on Windows.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
from bzrlib.repository import Repository
56
56
from bzrlib.revision import NULL_REVISION
57
57
from bzrlib.symbol_versioning import deprecated_function, deprecated_in
58
 
from bzrlib.trace import log_error, note
 
58
from bzrlib.trace import note
59
59
import bzrlib.ui
60
60
from bzrlib.workingtree import WorkingTree
61
61
 
201
201
                len(self.unreferenced_versions))
202
202
        if verbose and len(self.unreferenced_versions):
203
203
                for file_id, revision_id in self.unreferenced_versions:
204
 
                    log_error('unreferenced version: {%s} in %s', revision_id,
 
204
                    note('unreferenced version: {%s} in %s', revision_id,
205
205
                        file_id)
206
206
        if self.missing_inventory_sha_cnt:
207
207
            note('%6d revisions are missing inventory_sha1',
445
445
                    if do_branch:
446
446
                        scan_branch(branch, needed_refs, to_unlock)
447
447
            if do_branch and not branches:
448
 
                log_error("No branch found at specified location.")
 
448
                note("No branch found at specified location.")
449
449
            if do_tree and base_tree is None and not saw_tree:
450
 
                log_error("No working tree found at specified location.")
 
450
                note("No working tree found at specified location.")
451
451
            if do_repo or do_branch or do_tree:
452
452
                if do_repo:
453
453
                    note("Checking repository at '%s'."
457
457
                result.report_results(verbose)
458
458
        else:
459
459
            if do_tree:
460
 
                log_error("No working tree found at specified location.")
 
460
                note("No working tree found at specified location.")
461
461
            if do_branch:
462
 
                log_error("No branch found at specified location.")
 
462
                note("No branch found at specified location.")
463
463
            if do_repo:
464
 
                log_error("No repository found at specified location.")
 
464
                note("No repository found at specified location.")
465
465
    finally:
466
466
        for thing in to_unlock:
467
467
            thing.unlock()