/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: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-07-28 02:47:10 UTC
  • mfrom: (7519.1.1 merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200728024710-a2ylds219f1lsl62
Merge lp:brz/3.1.

Merged from https://code.launchpad.net/~jelmer/brz/merge-3.1/+merge/388173

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