/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 breezy/bisect.py

  • Committer: Jelmer Vernooij
  • Date: 2020-03-22 20:02:36 UTC
  • mto: (7490.7.7 work)
  • mto: This revision was merged to the branch mainline in revision 7501.
  • Revision ID: jelmer@jelmer.uk-20200322200236-fsbl91ktcn6fcbdd
Fix tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""bisect command implementations."""
18
18
 
 
19
from __future__ import absolute_import
 
20
 
19
21
import sys
20
22
from .controldir import ControlDir
21
23
from . import revision as _mod_revision
22
24
from .commands import Command
23
 
from .errors import CommandError
 
25
from .errors import BzrCommandError
24
26
from .option import Option
 
27
from .sixish import (
 
28
    text_type,
 
29
    )
25
30
from .trace import note
26
31
 
27
32
BISECT_INFO_PATH = "bisect"
309
314
 
310
315
    takes_args = ['subcommand', 'args*']
311
316
    takes_options = [Option('output', short_name='o',
312
 
                            help='Write log to this file.', type=str),
 
317
                            help='Write log to this file.', type=text_type),
313
318
                     'revision', 'directory']
314
319
 
315
320
    def _check(self, controldir):
316
321
        """Check preconditions for most operations to work."""
317
322
        if not controldir.control_transport.has(BISECT_INFO_PATH):
318
 
            raise CommandError("No bisection in progress.")
 
323
            raise BzrCommandError("No bisection in progress.")
319
324
 
320
325
    def _set_state(self, controldir, revspec, state):
321
326
        """Set the state of the given revspec and bisecting.
345
350
        elif subcommand in ('replay', ) and args_list and len(args_list) == 1:
346
351
            log_fn = args_list[0]
347
352
        elif subcommand in ('move', ) and not revision:
348
 
            raise CommandError(
 
353
            raise BzrCommandError(
349
354
                "The 'bisect move' command requires a revision.")
350
355
        elif subcommand in ('run', ):
351
356
            run_script = args_list[0]
352
357
        elif args_list or revision:
353
 
            raise CommandError(
 
358
            raise BzrCommandError(
354
359
                "Improper arguments to bisect " + subcommand)
355
360
 
356
361
        controldir, _ = ControlDir.open_containing(directory)
373
378
        elif subcommand == "run":
374
379
            self.run_bisect(controldir, run_script)
375
380
        else:
376
 
            raise CommandError(
 
381
            raise BzrCommandError(
377
382
                "Unknown bisect command: " + subcommand)
378
383
 
379
384
    def reset(self, controldir):