Merge lp:~jelmer/brz/remote-git-import 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/remote-git-import
Merge into: lp:brz
Diff against target: 80 lines (+17/-4)
3 files modified
breezy/git/branch.py (+1/-1)
breezy/git/commands.py (+13/-3)
doc/en/release-notes/brz-3.1.txt (+3/-0)
To merge this branch: bzr merge lp:~jelmer/brz/remote-git-import
Reviewer Review Type Date Requested Status
Martin Packman Approve
Review via email: mp+370029@code.launchpad.net

Commit message

Fix importing from remote git repositories.

Description of the change

Fix importing from remote git repositories.

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/branch.py'
2--- breezy/git/branch.py 2019-06-22 11:51:56 +0000
3+++ breezy/git/branch.py 2019-07-12 01:12:40 +0000
4@@ -785,7 +785,7 @@
5 :param refs: Refs dictionary (name -> git sha1)
6 :return: iterator over (ref_name, tag_name, peeled_sha1, unpeeled_sha1)
7 """
8- refs = self.repository._git.refs
9+ refs = self.repository.controldir.get_refs_container()
10 for ref_name, unpeeled in viewitems(refs.as_dict()):
11 try:
12 tag_name = ref_to_tag_name(ref_name)
13
14=== modified file 'breezy/git/commands.py'
15--- breezy/git/commands.py 2019-06-06 22:22:47 +0000
16+++ breezy/git/commands.py 2019-07-12 01:12:40 +0000
17@@ -24,12 +24,14 @@
18 from __future__ import absolute_import
19
20 import breezy.bzr # noqa: F401
21+from breezy import controldir
22 from ..commands import (
23 Command,
24 display_command,
25 )
26 from ..option import (
27 Option,
28+ RegistryOption,
29 )
30 from ..sixish import (
31 text_type,
32@@ -46,6 +48,15 @@
33
34 takes_options = [
35 Option('colocated', help='Create colocated branches.'),
36+ RegistryOption('dest-format',
37+ help='Specify a format for this branch. '
38+ 'See "help formats" for a full list.',
39+ lazy_registry=('breezy.controldir', 'format_registry'),
40+ converter=lambda name: controldir.format_registry.make_controldir(
41+ name),
42+ value_switches=True,
43+ title="Branch format",
44+ ),
45 ]
46
47 def _get_colocated_branch(self, target_controldir, name):
48@@ -69,7 +80,7 @@
49 except NotBranchError:
50 return head_controldir.create_branch()
51
52- def run(self, src_location, dest_location=None, colocated=False):
53+ def run(self, src_location, dest_location=None, colocated=False, dest_format=None):
54 import os
55 from .. import (
56 controldir,
57@@ -100,9 +111,8 @@
58 )
59 from .repository import GitRepository
60
61- dest_format = controldir.ControlDirFormat.get_default_format()
62 if dest_format is None:
63- raise BzrError('no default format')
64+ dest_format = controldir.format_registry.make_controldir('default')
65
66 if dest_location is None:
67 dest_location = os.path.basename(src_location.rstrip("/\\"))
68
69=== modified file 'doc/en/release-notes/brz-3.1.txt'
70--- doc/en/release-notes/brz-3.1.txt 2019-07-07 19:36:13 +0000
71+++ doc/en/release-notes/brz-3.1.txt 2019-07-12 01:12:40 +0000
72@@ -85,6 +85,9 @@
73 * Ignore UnknownFormatErrors when scanning for control directories.
74 (Jelmer Vernooij, #468332)
75
76+* Fix fetching from remote git repositories in ``brz git-import``.
77+ (Jelmer Vernooij, #1836238)
78+
79 Documentation
80 *************
81

Subscribers

People subscribed via source and target branches