RB4: Ensure that revisions are text before converting to unicode

Review Request #12798 — Created Jan. 23, 2023 and updated

puremourning
Review Board
release-4.0.x
1378d8b...
reviewboard

In commit b972f20c55, the diff parser was refactored to remove
DiffParser.get_orig_commit_id(). As aprt of that, a regression was
introduced into create_filediff() that meant whenever the parent revision
was an instance of Revision (rather than a str or bytes), we had a crash
in convert_to_unicode.

The parent revision can be a Revision object specifically whan it is
PRE_CREATION, such as when adding a new file to a Perforce repository.

This change re-introduces the coersion to string of the
parent_source_revision which was lost in the refactoring.

Fixes https://hellosplat.com/s/beanbag/tickets/4988/.
NOTE: A slightly different patch is required for RB5.

See also https://reviews.reviewboard.org/r/12799/

Re-do the steps that trigger the issue in https://hellosplat.com/s/beanbag/tickets/4988/. PASS

I tried to run the nose tests, and mostly they pass, but then the Perforce tests just hang. There seems to be some local setup required, but I couldn't find any info on setting up the environemnt that the tests expect.

puremourning
puremourning
puremourning
Review request changed

Status: Re-opened

Commit:

+1378d8b352dfae9e66a0293c3703f1ba1cf6a59e

Diff:

Revision 2 (+2 -2)

Show changes

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
Loading...