Merge lp:~jelmer/brz/git-branch-escaping 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-branch-escaping
Merge into: lp:brz
Diff against target: 66 lines (+7/-13)
3 files modified
breezy/plugins/propose/github.py (+1/-2)
breezy/plugins/propose/gitlabs.py (+1/-2)
breezy/plugins/propose/launchpad.py (+5/-9)
To merge this branch: bzr merge lp:~jelmer/brz/git-branch-escaping
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+374756@code.launchpad.net

Commit message

Use standard functions for creating Git URLs.

Description of the change

Use standard functions for creating Git URLs.

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/plugins/propose/github.py'
2--- breezy/plugins/propose/github.py 2019-10-05 21:27:35 +0000
3+++ breezy/plugins/propose/github.py 2019-10-27 13:50:28 +0000
4@@ -207,8 +207,7 @@
5 def github_url_to_bzr_url(url, branch_name):
6 if not PY3:
7 branch_name = branch_name.encode('utf-8')
8- return urlutils.join_segment_parameters(
9- git_url_to_bzr_url(url), {"branch": branch_name})
10+ return git_url_to_bzr_url(url, branch_name)
11
12
13 class GitHub(Hoster):
14
15=== modified file 'breezy/plugins/propose/gitlabs.py'
16--- breezy/plugins/propose/gitlabs.py 2019-10-05 21:25:39 +0000
17+++ breezy/plugins/propose/gitlabs.py 2019-10-27 13:50:28 +0000
18@@ -238,8 +238,7 @@
19 def gitlab_url_to_bzr_url(url, name):
20 if not PY3:
21 name = name.encode('utf-8')
22- return urlutils.join_segment_parameters(
23- git_url_to_bzr_url(url), {"branch": name})
24+ return git_url_to_bzr_url(url, branch=name)
25
26
27 class GitLab(Hoster):
28
29=== modified file 'breezy/plugins/propose/launchpad.py'
30--- breezy/plugins/propose/launchpad.py 2019-09-21 14:54:21 +0000
31+++ breezy/plugins/propose/launchpad.py 2019-10-27 13:50:28 +0000
32@@ -39,7 +39,7 @@
33 hooks,
34 urlutils,
35 )
36-from ...git.refs import ref_to_branch_name
37+from ...git.urls import git_url_to_bzr_url
38 from ...lazy_import import lazy_import
39 lazy_import(globals(), """
40 from breezy.plugins.launchpad import (
41@@ -114,21 +114,17 @@
42 if self._mp.source_branch:
43 return self._mp.source_branch.bzr_identity
44 else:
45- branch_name = ref_to_branch_name(
46- self._mp.source_git_path.encode('utf-8'))
47- return urlutils.join_segment_parameters(
48+ return git_url_to_bzr_url(
49 self._mp.source_git_repository.git_identity,
50- {"branch": str(branch_name)})
51+ ref=self._mp.source_git_path.encode('utf-8'))
52
53 def get_target_branch_url(self):
54 if self._mp.target_branch:
55 return self._mp.target_branch.bzr_identity
56 else:
57- branch_name = ref_to_branch_name(
58- self._mp.target_git_path.encode('utf-8'))
59- return urlutils.join_segment_parameters(
60+ return git_url_to_bzr_url(
61 self._mp.target_git_repository.git_identity,
62- {"branch": str(branch_name)})
63+ ref=self._mp.target_git_path.encode('utf-8'))
64
65 @property
66 def url(self):

Subscribers

People subscribed via source and target branches