Merge lp:~jelmer/brz/more-git-errors 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/more-git-errors
Merge into: lp:brz
Diff against target: 28 lines (+6/-1)
2 files modified
breezy/git/remote.py (+2/-1)
breezy/git/tests/test_remote.py (+4/-0)
To merge this branch: bzr merge lp:~jelmer/brz/more-git-errors
Reviewer Review Type Date Requested Status
Martin Packman Approve
Review via email: mp+354801@code.launchpad.net

Commit message

Handle the Launchpad way of saying "Repository not found".

Description of the change

Handle another way of formatting "Repository not found".

This is the format used by Launchpad.

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

Looks good, though see comment.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'breezy/git/remote.py'
--- breezy/git/remote.py 2018-09-11 19:38:39 +0000
+++ breezy/git/remote.py 2018-09-12 17:23:34 +0000
@@ -194,7 +194,8 @@
194 """194 """
195 message = str(message).strip()195 message = str(message).strip()
196 if (message.startswith("Could not find Repository ") or196 if (message.startswith("Could not find Repository ") or
197 message == 'Repository not found.'):197 message == 'Repository not found.' or
198 (message.startswith('Repository ') and message.endswith(' not found.'))):
198 return NotBranchError(url, message)199 return NotBranchError(url, message)
199 if message == "HEAD failed to update":200 if message == "HEAD failed to update":
200 base_url, _ = urlutils.split_segment_parameters(url)201 base_url, _ = urlutils.split_segment_parameters(url)
201202
=== modified file 'breezy/git/tests/test_remote.py'
--- breezy/git/tests/test_remote.py 2018-09-11 19:36:00 +0000
+++ breezy/git/tests/test_remote.py 2018-09-12 17:23:34 +0000
@@ -88,6 +88,10 @@
88 e = parse_git_error("url", "\n Could not find Repository foo/bar")88 e = parse_git_error("url", "\n Could not find Repository foo/bar")
89 self.assertIsInstance(e, NotBranchError)89 self.assertIsInstance(e, NotBranchError)
9090
91 def test_notbrancherror_launchpad(self):
92 e = parse_git_error("url", "Repository 'foo/bar' not found.")
93 self.assertIsInstance(e, NotBranchError)
94
91 def test_notbrancherror_github(self):95 def test_notbrancherror_github(self):
92 e = parse_git_error("url", "Repository not found.\n")96 e = parse_git_error("url", "Repository not found.\n")
93 self.assertIsInstance(e, NotBranchError)97 self.assertIsInstance(e, NotBranchError)

Subscribers

People subscribed via source and target branches