Re-introduce working support for --diff-only.

Review Request #9427 — Created Dec. 6, 2017 and submitted

Information

RBTools
release-0.7.x
7d8aba9...

Reviewers

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 -u or -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 changenum field 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
(except for public, if --publish is 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.

Tested with --diff-only and 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.

Description From Last Updated

Did you test this with a perforce change?

daviddavid

E271 multiple spaces after keyword

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

david
  1. 
      
  2. Show all issues

    Did you test this with a perforce change?

    1. Yeah. Updating the testing.

  3. 
      
chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.7.x (d4906d0)
Loading...