Merge lp:~jelmer/brz/check-wants into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 7104
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/check-wants
Merge into: lp:brz
Diff against target: 51 lines (+10/-5)
1 file modified
breezy/git/interrepo.py (+10/-5)
To merge this branch: bzr merge lp:~jelmer/brz/check-wants
Reviewer Review Type Date Requested Status
Martin Packman Approve
Review via email: mp+354737@code.launchpad.net

Commit message

Don't try to fetch peeled tags.

Description of the change

Don't try to fetch peeled tags.

(Newer versions of Dulwich throw an exception when attempting this)

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/git/interrepo.py'
2--- breezy/git/interrepo.py 2018-08-04 17:32:58 +0000
3+++ breezy/git/interrepo.py 2018-09-12 00:50:25 +0000
4@@ -31,7 +31,10 @@
5 CAPABILITY_THIN_PACK,
6 ZERO_SHA,
7 )
8-from dulwich.refs import SYMREF
9+from dulwich.refs import (
10+ ANNOTATED_TAG_SUFFIX,
11+ SYMREF,
12+ )
13 from dulwich.walk import Walker
14
15 from ..errors import (
16@@ -345,7 +348,7 @@
17 raise NoPushSupport(self.source, self.target, self.mapping)
18 unpeel_map = UnpeelMap.from_repository(self.source)
19 revidmap = {}
20- def determine_wants(old_refs):
21+ def git_update_refs(old_refs):
22 ret = {}
23 self.old_refs = dict([(k, (v, None)) for (k, v) in viewitems(old_refs)])
24 self.new_refs = update_refs(self.old_refs)
25@@ -360,7 +363,7 @@
26 return ret
27 self._warn_slow()
28 with self.source_store.lock_read():
29- new_refs = self.target.send_pack(determine_wants,
30+ new_refs = self.target.send_pack(git_update_refs,
31 self.source_store.generate_lossy_pack_data)
32 # FIXME: revidmap?
33 return revidmap, self.old_refs, self.new_refs
34@@ -399,7 +402,7 @@
35 potential = set(wants)
36 if include_tags:
37 for k, unpeeled in viewitems(refs):
38- if k.endswith(b"^{}"):
39+ if k.endswith(ANNOTATED_TAG_SUFFIX):
40 continue
41 if not is_tag(k):
42 continue
43@@ -694,7 +697,9 @@
44 return self.get_determine_wants_heads(wants, include_tags=include_tags)
45
46 def determine_wants_all(self, refs):
47- potential = set([v for v in refs.values() if not v == ZERO_SHA])
48+ potential = set([
49+ v for k, v in refs.items()
50+ if not v == ZERO_SHA and not k.endswith(ANNOTATED_TAG_SUFFIX)])
51 return list(potential - self._target_has_shas(potential))
52
53

Subscribers

People subscribed via source and target branches