Fix lookup of files containing special characters in Subversion.

Review Request #11020 — Created May 14, 2020 and submitted — Latest diff uploaded

Information

Review Board
release-3.0.x

Reviewers

This change fixes looking up files that contain characters that may be
considered special in a URL, such as # or ?. There's a bit of a
backstory to this change.

Back in 2008, when the Subversion support was brand-new, we accepted a
patch that fixed looking up filenames containing spaces. Things with our
implementation was different back then, and this patch accomplished its
goals by taking a normalized URL to a file in Subversion, splitting the
path out, quoting its contents, and rebuilding the path.

The act of splitting the path resulted in # and ? characters being
split from the rest of the path, and they weren't put back in. This came
up in a bug report from Rob Petti, who provided a patch designed to work
around the bad behavior in the original implementation. After some
investigation, we figured out part of what was going on, and Rob built
an implementation that addresses the issue at its core, removing the
older code in the process.

This change builds on top of that, making some tweaks based on my
investigations into the original change, and Subversion compatibility.
It turns out that these days, we do not need to quote anything going
into Subversion paths (on either the PySVN or Subvertpy backends), but
as this was a problem at some point, we'll continue to quote for
compatibility.

Unit tests were added for both normalization and for lookup of files
containing spaces, &, #, and ? characters, using new files added
to our test repository.

Unit tests pass with both PySVN and Subvertpy backends.

Commits

Files

    Loading...