Re-introduce working support for --diff-only.
Review Request #9427 - Created Dec. 7, 2017 and updated
The --diff-only flag has not really worked correctly in a while. Its
purpose was to only post a diff for review, ignoring anything content in
a Perforce change description, and it didn't do anything at all for
non-Perforce repositories. It just controlled whether we set a change
number server-side, which would cause Review Board to pull down a new
change description from Perforce.
It was originally orthogonal to review request guessing, but recently
Perforce received guessing support. Normally, with default settings,
guessing only happens when not passing
-r, but with Perforce,
you don't pass either of these. You just pass a change number. So,
guessing would kick in and cause a summary and description to be
provided. It also unconditionally caused the
changenumfield to also
be provided, which triggered the server-side updating.
This change restores the original intent of
--diff-only, and makes it
universal. Now, if specified, only the diff will be uploaded. All fields
--publishis specified) will be left out of
any payload. It disables guessing, disables fields specified on the
command line, and disables commit IDs/change numbers.
This should restore the expected behavior on Perforce and provide
benefits to those on other types of repositories.
--diff-onlyand verified that only the diff information
was provided in the payload, and that guessed fields and the change
number/commit ID were not.
This was tested (along with
--change-only) on both Perforce and Git.