Merge lp:~jelmer/brz/git-probing into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/git-probing
Merge into: lp:brz
Diff against target: 92 lines (+23/-14)
4 files modified
breezy/git/__init__.py (+2/-1)
breezy/git/dir.py (+1/-1)
breezy/git/interrepo.py (+17/-12)
breezy/git/remote.py (+3/-0)
To merge this branch: bzr merge lp:~jelmer/brz/git-probing
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+375651@code.launchpad.net

Commit message

Various improvements for Git repository probing.

Description of the change

Various improvements for Git repository probing.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/git/__init__.py'
2--- breezy/git/__init__.py 2019-11-02 23:19:18 +0000
3+++ breezy/git/__init__.py 2019-11-18 03:45:28 +0000
4@@ -183,13 +183,14 @@
5 if ct and ct.startswith("application/x-git"):
6 from .remote import RemoteGitControlDirFormat
7 return RemoteGitControlDirFormat()
8- else:
9+ elif not ct:
10 from .dir import (
11 BareLocalGitControlDirFormat,
12 )
13 ret = BareLocalGitControlDirFormat()
14 ret._refs_text = resp.read()
15 return ret
16+ raise brz_errors.NotBranchError(transport.base)
17
18 def probe_transport(self, transport):
19 try:
20
21=== modified file 'breezy/git/dir.py'
22--- breezy/git/dir.py 2019-11-03 12:38:45 +0000
23+++ breezy/git/dir.py 2019-11-18 03:45:28 +0000
24@@ -363,7 +363,7 @@
25 trace.note(redirection_notice)
26 return transport._redirected_to(e.source, e.target)
27 gitrepo = do_catching_redirections(_open, transport, redirected)
28- if not gitrepo._controltransport.has('objects'):
29+ if not _found and not gitrepo._controltransport.has('objects'):
30 raise brz_errors.NotBranchError(path=transport.base)
31 return LocalGitDir(transport, gitrepo, self)
32
33
34=== modified file 'breezy/git/interrepo.py'
35--- breezy/git/interrepo.py 2019-10-20 22:56:43 +0000
36+++ breezy/git/interrepo.py 2019-11-18 03:45:28 +0000
37@@ -671,18 +671,8 @@
38 "Unsupported search result type %s" % recipe[0])
39 args = heads
40 if branches is not None:
41- def determine_wants(refs):
42- ret = []
43- for name, value in viewitems(refs):
44- if value == ZERO_SHA:
45- continue
46-
47- if name.endswith(ANNOTATED_TAG_SUFFIX):
48- continue
49-
50- if name in branches or (include_tags and is_tag(name)):
51- ret.append(value)
52- return ret
53+ determine_wants = self.get_determine_wants_branches(
54+ branches, include_tags=include_tags)
55 elif fetch_spec is None and revision_id is None:
56 determine_wants = self.determine_wants_all
57 else:
58@@ -701,6 +691,21 @@
59 wants.add(git_sha)
60 return self.get_determine_wants_heads(wants, include_tags=include_tags)
61
62+ def get_determine_wants_branches(self, branches, include_tags=False):
63+ def determine_wants(refs):
64+ ret = []
65+ for name, value in viewitems(refs):
66+ if value == ZERO_SHA:
67+ continue
68+
69+ if name.endswith(ANNOTATED_TAG_SUFFIX):
70+ continue
71+
72+ if name in branches or (include_tags and is_tag(name)):
73+ ret.append(value)
74+ return ret
75+ return determine_wants
76+
77 def determine_wants_all(self, refs):
78 potential = set([
79 v for k, v in refs.items()
80
81=== modified file 'breezy/git/remote.py'
82--- breezy/git/remote.py 2019-08-11 16:27:38 +0000
83+++ breezy/git/remote.py 2019-11-18 03:45:28 +0000
84@@ -843,6 +843,9 @@
85 def get_file_text(self, path):
86 raise GitSmartRemoteNotSupported(self.get_file_text, self)
87
88+ def list_files(self, include_root=False, from_dir=None, recursive=True):
89+ raise GitSmartRemoteNotSupported(self.list_files, self)
90+
91
92 class RemoteGitRepository(GitRepository):
93

Subscribers

People subscribed via source and target branches