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

Review Request #9427 - Created Dec. 7, 2017 and updated

Christian Hammond
RBTools
release-0.7.x
7d8aba9...
rbtools

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.

  • 0
  • 0
  • 2
  • 0
  • 2
Description From Last Updated
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

David Trowbridge
  1. 
      
  2. Did you test this with a perforce change?

    1. Yeah. Updating the testing.

  3. 
      
Christian Hammond
Review request changed

Testing Done:

   

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.

David Trowbridge
  1. Ship It!
  2. 
      
Loading...