/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/git/git-remote-bzr

  • Committer: Jelmer Vernooij
  • Date: 2020-04-05 19:11:34 UTC
  • mto: (7490.7.16 work)
  • mto: This revision was merged to the branch mainline in revision 7501.
  • Revision ID: jelmer@jelmer.uk-20200405191134-0aebh8ikiwygxma5
Populate the .gitignore file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python3
 
2
# vim: expandtab
 
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
 
18
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
19
 
 
20
 
 
21
"""Remote helper for git for accessing bzr repositories."""
 
22
 
 
23
import optparse
 
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
 
 
32
import breezy
 
33
breezy.initialize()
 
34
 
 
35
from breezy.sixish import PY3
 
36
 
 
37
from breezy.plugin import load_plugins
 
38
load_plugins()
 
39
 
 
40
from breezy.git.git_remote_helper import (
 
41
    RemoteHelper,
 
42
    open_local_dir,
 
43
    open_remote_dir,
 
44
    )
 
45
 
 
46
parser = optparse.OptionParser()
 
47
(opts, args) = parser.parse_args()
 
48
(shortname, url) = args
 
49
 
 
50
helper = RemoteHelper(open_local_dir(), shortname, open_remote_dir(url))
 
51
if PY3:
 
52
    helper.process(sys.stdin.buffer, sys.stdout.buffer)
 
53
else:
 
54
    helper.process(sys.stdin, sys.stdout)