Merge lp:~jelmer/brz/segmentsurl into lp:brz/3.0

Proposed by Jelmer Vernooij on 2019-02-27
Status: Merged
Approved by: Jelmer Vernooij on 2019-03-04
Approved revision: 7293
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/segmentsurl
Merge into: lp:brz/3.0
Diff against target: 43 lines (+10/-1)
3 files modified
breezy/tests/test_urlutils.py (+3/-0)
breezy/urlutils.py (+4/-1)
doc/en/release-notes/brz-3.0.txt (+3/-0)
To merge this branch: bzr merge lp:~jelmer/brz/segmentsurl
Reviewer Review Type Date Requested Status
Martin Packman 2019-02-27 Approve on 2019-03-03
Review via email: mp+363699@code.launchpad.net

Commit message

Raise better error when subsegments lack =.

Description of the change

Raise better error when subsegments lack =.

To post a comment you must log in.
Martin Packman (gz) wrote :

Thanks!

review: Approve
lp:~jelmer/brz/segmentsurl updated on 2019-03-04
7293. By Jelmer Vernooij on 2019-03-04

Merge lp:brz/3.0.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'breezy/tests/test_urlutils.py'
--- breezy/tests/test_urlutils.py 2018-11-23 03:06:01 +0000
+++ breezy/tests/test_urlutils.py 2019-03-04 02:08:13 +0000
@@ -599,6 +599,9 @@
599 self.assertEqual(("foo/base,key1=val1/other/elements",599 self.assertEqual(("foo/base,key1=val1/other/elements",
600 {"key2": "val2"}), split_segment_parameters(600 {"key2": "val2"}), split_segment_parameters(
601 "foo/base,key1=val1/other/elements,key2=val2"))601 "foo/base,key1=val1/other/elements,key2=val2"))
602 self.assertRaises(
603 urlutils.InvalidURL, split_segment_parameters,
604 "foo/base,key1")
602 # TODO: Check full URLs as well as relative references605 # TODO: Check full URLs as well as relative references
603606
604 def test_win32_strip_local_trailing_slash(self):607 def test_win32_strip_local_trailing_slash(self):
605608
=== modified file 'breezy/urlutils.py'
--- breezy/urlutils.py 2018-11-12 01:41:38 +0000
+++ breezy/urlutils.py 2019-03-04 02:08:13 +0000
@@ -561,7 +561,10 @@
561 (base_url, subsegments) = split_segment_parameters_raw(url)561 (base_url, subsegments) = split_segment_parameters_raw(url)
562 parameters = {}562 parameters = {}
563 for subsegment in subsegments:563 for subsegment in subsegments:
564 (key, value) = subsegment.split("=", 1)564 try:
565 (key, value) = subsegment.split("=", 1)
566 except ValueError:
567 raise InvalidURL(url, "missing = in subsegment")
565 if not isinstance(key, str):568 if not isinstance(key, str):
566 raise TypeError(key)569 raise TypeError(key)
567 if not isinstance(value, str):570 if not isinstance(value, str):
568571
=== modified file 'doc/en/release-notes/brz-3.0.txt'
--- doc/en/release-notes/brz-3.0.txt 2019-03-04 00:35:07 +0000
+++ doc/en/release-notes/brz-3.0.txt 2019-03-04 02:08:13 +0000
@@ -233,6 +233,9 @@
233* Don't report .git files as unknown files.233* Don't report .git files as unknown files.
234 (Jelmer Vernooij, Debian Bug #921240)234 (Jelmer Vernooij, Debian Bug #921240)
235235
236* Raise better error when path subsegments lack =.
237 (Jelmer Vernooij, #891483)
238
236* Display correct pull location argument in239* Display correct pull location argument in
237 output of ``brz uncommit``.240 output of ``brz uncommit``.
238 (Jelmer Vernooij, #386577)241 (Jelmer Vernooij, #386577)

Subscribers

People subscribed via source and target branches