/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 remote.py

Partially fix pull.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
import bzrlib
18
18
from bzrlib import urlutils
19
19
from bzrlib.bzrdir import BzrDir, BzrDirFormat
20
 
from bzrlib.errors import BzrError, NoSuchFile, NotLocalUrl
 
20
from bzrlib.errors import NoSuchFile, NotLocalUrl
21
21
from bzrlib.lockable_files import TransportLock
22
22
from bzrlib.repository import Repository
23
23
from bzrlib.trace import info
38
38
import urlparse
39
39
 
40
40
import dulwich as git
41
 
from dulwich.errors import GitProtocolError
42
41
from dulwich.pack import PackData, Pack, PackIndex
43
42
 
44
43
# Don't run any tests on GitSmartTransport as it is not intended to be 
57
56
        (self._host, self._port) = urllib.splitnport(hostport, git.protocol.TCP_GIT_PORT)
58
57
        self._client = _client
59
58
 
60
 
    def has(self, relpath):
61
 
        return False
62
 
 
63
59
    def _get_client(self):
64
60
        if self._client is not None:
65
61
            ret = self._client
66
62
            self._client = None
67
63
            return ret
68
 
        return git.client.TCPGitClient(self._host, self._port, thin_packs=False)
 
64
        return git.client.TCPGitClient(self._host, self._port, 
 
65
            capabilities=["multi_ack", "side-band-64k", "ofs-delta", "side-band"])
69
66
 
70
67
    def fetch_pack(self, determine_wants, graph_walker, pack_data, progress=None):
71
68
        if progress is None:
72
69
            def progress(text):
73
70
                info("git: %s" % text)
74
 
        client = self._get_client()
75
 
        try:
76
 
            client.fetch_pack(self._path, determine_wants, 
77
 
                graph_walker, pack_data, progress)
78
 
        except GitProtocolError, e:
79
 
            raise BzrError(e)
 
71
        self._get_client().fetch_pack(self._path, determine_wants, 
 
72
            graph_walker, pack_data, progress)
80
73
 
81
74
    def get(self, path):
82
75
        raise NoSuchFile(path)