Merge lp:~jelmer/bzr-upload/only-strip-slash into lp:bzr-upload

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Martin Packman
Approved revision: 84
Merged at revision: 88
Proposed branch: lp:~jelmer/bzr-upload/only-strip-slash
Merge into: lp:bzr-upload
Diff against target: 11 lines (+1/-1)
1 file modified
tests/test_upload.py (+1/-1)
To merge this branch: bzr merge lp:~jelmer/bzr-upload/only-strip-slash
Reviewer Review Type Date Requested Status
Martin Pool (community) Approve
Martin Packman (community) Approve
Review via email: mp+80111@code.launchpad.net

Description of the change

In a test, only remove the last character from a branch base if it is a slash.

This fixes running the bzr-upload testsuite when run against bzr-svn.

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

Only stripping trailing slashes is clearly an improvement on always removing whatever the last character is and this should clearly land.

However, doing url manipulation with basic string functions, even simple stuff like this, makes me nervous. I'm thinking particularly of this change:

<https://code.launchpad.net/~gz/bzr/root_drive_file_url_841322/+merge/74034>

         self.base = base
- self._segment_parameters = urlutils.split_segment_parameters(
- base.rstrip("/"))[1]
+ self._segment_parameters = urlutils.split_segment_parameters(base)[1]

Which was needed to avoid some very surprising breakage.

review: Approve
Revision history for this message
Martin Pool (mbp) wrote :

  vote approve
  review approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/test_upload.py'
2--- tests/test_upload.py 2011-07-09 11:13:45 +0000
3+++ tests/test_upload.py 2011-10-21 22:40:29 +0000
4@@ -756,7 +756,7 @@
5 b = self.get_branch()
6 open(fn, 'wt').write(("[%s]\n"
7 "upload_location=foo\n" %
8- b.base[:-1]))
9+ b.base.rstrip("/")))
10 conf = b.get_config()
11 self.assertEqual("foo", conf.get_user_option('upload_location'))
12

Subscribers

People subscribed via source and target branches

to status/vote changes: