/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/plugins/fastimport/cmds.py

  • Committer: Jelmer Vernooij
  • Date: 2020-06-21 02:15:25 UTC
  • mto: (7490.40.23 work)
  • mto: This revision was merged to the branch mainline in revision 7517.
  • Revision ID: jelmer@jelmer.uk-20200621021525-en904vhtu6t0qcv3
Rename BzrCommandError to CommandError.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
    :param user_map: if not None, the file containing the user map.
42
42
    """
43
43
    from fastimport.errors import ParsingError
44
 
    from ...errors import BzrCommandError
 
44
    from ...errors import CommandError
45
45
    from fastimport import parser
46
46
    stream = _get_source_stream(source)
47
47
    user_mapper = _get_user_mapper(user_map)
50
50
    try:
51
51
        return proc.process(p.iter_commands)
52
52
    except ParsingError as e:
53
 
        raise BzrCommandError("%d: Parse error: %s" % (e.lineno, e))
 
53
        raise CommandError("%d: Parse error: %s" % (e.lineno, e))
54
54
 
55
55
 
56
56
def _get_source_stream(source):
325
325
        from ...sixish import StringIO
326
326
        from fastimport import parser
327
327
        from fastimport.errors import ParsingError
328
 
        from ...errors import BzrCommandError
 
328
        from ...errors import CommandError
329
329
        from fastimport.processors import info_processor
330
330
        stream = _get_source_stream(source)
331
331
        output = StringIO()
335
335
            try:
336
336
                return_code = proc.process(p.iter_commands)
337
337
            except ParsingError as e:
338
 
                raise BzrCommandError("%d: Parse error: %s" % (e.lineno, e))
 
338
                raise CommandError("%d: Parse error: %s" % (e.lineno, e))
339
339
            lines = output.getvalue().splitlines()
340
340
        finally:
341
341
            output.close()