/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: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-06-01 21:57:00 UTC
  • mfrom: (7490.39.3 move-launchpad)
  • Revision ID: breezy.the.bot@gmail.com-20200601215700-joxuzo6w172gq74v
Move launchpad hoster support to the launchpad plugin.

Merged from https://code.launchpad.net/~jelmer/brz/move-launchpad/+merge/384931

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 CommandError
 
39
    from ...errors import BzrCommandError
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 CommandError("%d: Parse error: %s" % (e.lineno, e))
 
48
        raise BzrCommandError("%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 CommandError
 
323
        from ...errors import BzrCommandError
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 CommandError("%d: Parse error: %s" % (e.lineno, e))
 
333
                raise BzrCommandError("%d: Parse error: %s" % (e.lineno, e))
334
334
            lines = output.getvalue().splitlines()
335
335
        finally:
336
336
            output.close()