/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
7476.2.1 by Jelmer Vernooij
Default to running Python 3.
1
#!/usr/bin/env python3
0.269.2 by Jelmer Vernooij
Implement 'option' and 'list' in git-remote-bzr
2
# vim: expandtab
0.269.1 by Jelmer Vernooij
add git remote helper
3
4
# Copyright (C) 2011 Jelmer Vernooij <jelmer@apache.org>
5
6
# This program is free software; you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; either version 2 of the License, or
9
# (at your option) any later version.
10
#
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
# GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License
17
# along with this program; if not, write to the Free Software
0.358.1 by Jelmer Vernooij
Fix FSF address.
18
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
0.269.1 by Jelmer Vernooij
add git remote helper
19
20
21
"""Remote helper for git for accessing bzr repositories."""
22
0.200.1514 by Jelmer Vernooij
Move git_remote_helper to a python module.
23
import optparse
0.200.1425 by Jelmer Vernooij
Don't print back trace when git-remote-bzr is interrupted.
24
import signal
25
import sys
26
27
def handle_sigint(signal, frame):
28
    sys.exit(0)
29
30
signal.signal(signal.SIGINT, handle_sigint)
31
0.200.1646 by Jelmer Vernooij
Rename bzrlib to breezy.
32
import breezy
33
breezy.initialize()
0.269.1 by Jelmer Vernooij
add git remote helper
34
0.200.1646 by Jelmer Vernooij
Rename bzrlib to breezy.
35
from breezy.plugin import load_plugins
0.269.1 by Jelmer Vernooij
add git remote helper
36
load_plugins()
37
7290.11.1 by Jelmer Vernooij
Fix remote helper.
38
from breezy.git.git_remote_helper import (
0.200.1514 by Jelmer Vernooij
Move git_remote_helper to a python module.
39
    RemoteHelper,
40
    open_local_dir,
41
    open_remote_dir,
42
    )
0.269.1 by Jelmer Vernooij
add git remote helper
43
7490.57.1 by Jelmer Vernooij
Add a warning in git-remote-bzr.
44
from breezy.trace import warning
45
0.269.1 by Jelmer Vernooij
add git remote helper
46
parser = optparse.OptionParser()
47
(opts, args) = parser.parse_args()
48
(shortname, url) = args
49
7490.57.1 by Jelmer Vernooij
Add a warning in git-remote-bzr.
50
warning(
51
    'git-remote-bzr is experimental and has not been optimized for '
52
    'performance. Use \'brz fast-export\' and \'git fast-import\' for '
53
    'large repositories.')
54
0.200.1514 by Jelmer Vernooij
Move git_remote_helper to a python module.
55
helper = RemoteHelper(open_local_dir(), shortname, open_remote_dir(url))
7479.2.1 by Jelmer Vernooij
Drop python2 support.
56
helper.process(sys.stdin.buffer, sys.stdout.buffer)