Merge lp:~wgrant/bzr-git/thin-packs into lp:bzr-git

Proposed by William Grant
Status: Merged
Merged at revision: 1621
Proposed branch: lp:~wgrant/bzr-git/thin-packs
Merge into: lp:bzr-git
Diff against target: 56 lines (+12/-5)
2 files modified
NEWS (+7/-0)
remote.py (+5/-5)
To merge this branch: bzr merge lp:~wgrant/bzr-git/thin-packs
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+180770@code.launchpad.net

Commit message

Support thin packs in fetch_pack and send_pack, since dulwich now handles them properly.

Description of the change

This branch enables thin pack support, allowing fetches from servers like Google Code that refuse to send thick packs. It requires minor Dulwich changes: <https://github.com/jelmer/dulwich/pull/102>. Additional CPU usage should be minimal, as we need to have a complete SHA-1 map to fetch successfully anyway, and delta application is fairly fast.

The lack of thin pack support was the root cause of bug #1072461; my previous fix just meant it successfully negotiated thin-packs out of the picture. It looks like there was a previous attempt to support thin packs, in that pack.resolve_ext_ref was being set even though nothing Dulwich used it.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

rock on.

review: Approve
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

(dulwich changes look reasonable too, but I'm not near my laptop at the moment)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NEWS'
--- NEWS 2013-08-04 17:05:17 +0000
+++ NEWS 2013-08-19 05:21:49 +0000
@@ -1,3 +1,10 @@
10.6.12 UNRELEASED
2
3 FEATURES
4
5 * Support thin packs when pushing and fetching to/from remote
6 repositories. (William Grant, #878085)
7
10.6.11 2013-08-0480.6.11 2013-08-04
29
3 BUG FIXES10 BUG FIXES
411
=== modified file 'remote.py'
--- remote.py 2013-08-14 03:59:20 +0000
+++ remote.py 2013-08-19 05:21:49 +0000
@@ -230,7 +230,7 @@
230 trace.info("git: %s" % text)230 trace.info("git: %s" % text)
231 def wrap_determine_wants(refs_dict):231 def wrap_determine_wants(refs_dict):
232 return determine_wants(remote_refs_dict_to_container(refs_dict))232 return determine_wants(remote_refs_dict_to_container(refs_dict))
233 client = self._get_client(thin_packs=False)233 client = self._get_client(thin_packs=True)
234 try:234 try:
235 refs_dict = client.fetch_pack(self._client_path, wrap_determine_wants,235 refs_dict = client.fetch_pack(self._client_path, wrap_determine_wants,
236 graph_walker, pack_data, progress)236 graph_walker, pack_data, progress)
@@ -240,7 +240,7 @@
240 raise parse_git_error(self.transport.external_url(), e)240 raise parse_git_error(self.transport.external_url(), e)
241241
242 def send_pack(self, get_changed_refs, generate_pack_contents):242 def send_pack(self, get_changed_refs, generate_pack_contents):
243 client = self._get_client(thin_packs=False)243 client = self._get_client(thin_packs=True)
244 try:244 try:
245 return client.send_pack(self._client_path, get_changed_refs,245 return client.send_pack(self._client_path, get_changed_refs,
246 generate_pack_contents)246 generate_pack_contents)
@@ -309,8 +309,8 @@
309class TemporaryPackIterator(Pack):309class TemporaryPackIterator(Pack):
310310
311 def __init__(self, path, resolve_ext_ref):311 def __init__(self, path, resolve_ext_ref):
312 super(TemporaryPackIterator, self).__init__(path)312 super(TemporaryPackIterator, self).__init__(
313 self.resolve_ext_ref = resolve_ext_ref313 path, resolve_ext_ref=resolve_ext_ref)
314 self._idx_load = lambda: self._idx_load_or_generate(self._idx_path)314 self._idx_load = lambda: self._idx_load_or_generate(self._idx_path)
315315
316 def _idx_load_or_generate(self, path):316 def _idx_load_or_generate(self, path):
@@ -376,7 +376,7 @@
376 get_client = transport._get_client376 get_client = transport._get_client
377 client_path = transport._get_path()377 client_path = transport._get_path()
378 elif urlparse.urlsplit(transport.external_url())[0] in ("http", "https"):378 elif urlparse.urlsplit(transport.external_url())[0] in ("http", "https"):
379 def get_client(thin_packs=False):379 def get_client(thin_packs):
380 return BzrGitHttpClient(transport, thin_packs=thin_packs)380 return BzrGitHttpClient(transport, thin_packs=thin_packs)
381 client_path, _ = urlutils.split_segment_parameters(transport._path)381 client_path, _ = urlutils.split_segment_parameters(transport._path)
382 else:382 else:

Subscribers

People subscribed via source and target branches

to all changes: