/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-23 01:02:30 UTC
  • mfrom: (7490.40.27 work)
  • mto: This revision was merged to the branch mainline in revision 7517.
  • Revision ID: jelmer@jelmer.uk-20200623010230-62nnywznmb76h6ut
Merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    :param user_map: if not None, the file containing the user map.
37
37
    """
38
38
    from fastimport.errors import ParsingError
39
 
    from ...errors import BzrCommandError
 
39
    from ...errors import CommandError
40
40
    from fastimport import parser
41
41
    stream = _get_source_stream(source)
42
42
    user_mapper = _get_user_mapper(user_map)
45
45
    try:
46
46
        return proc.process(p.iter_commands)
47
47
    except ParsingError as e:
48
 
        raise BzrCommandError("%d: Parse error: %s" % (e.lineno, e))
 
48
        raise CommandError("%d: Parse error: %s" % (e.lineno, e))
49
49
 
50
50
 
51
51
def _get_source_stream(source):
320
320
        from io import StringIO
321
321
        from fastimport import parser
322
322
        from fastimport.errors import ParsingError
323
 
        from ...errors import BzrCommandError
 
323
        from ...errors import CommandError
324
324
        from fastimport.processors import info_processor
325
325
        stream = _get_source_stream(source)
326
326
        output = StringIO()
330
330
            try:
331
331
                return_code = proc.process(p.iter_commands)
332
332
            except ParsingError as e:
333
 
                raise BzrCommandError("%d: Parse error: %s" % (e.lineno, e))
 
333
                raise CommandError("%d: Parse error: %s" % (e.lineno, e))
334
334
            lines = output.getvalue().splitlines()
335
335
        finally:
336
336
            output.close()