4368: rbt post --diff-only no longer works correctly

sallan

What version are you running?

RBTools 0.7.4 on Windows.
ReviewBoard version 2.0.18
Perforce 2014.2

What steps will reproduce the problem?

  • Create a numbered perforce change list with a description.
  • Use to create a new review request
    $ rbt post CL
  • Publish review
  • Manually edit the description field in the review request
  • Update the file diffs using --diff-only to leave the description alone
    $ rbt post --diff-only CL
  • Note the changes made in the description field in the review request have been replaced with the perforce change list description again.

What is the expected output? What do you see instead?

Using the --diff-only option, I expect my changes made to the description field in the review request to be left in tact. Instead, they are being replaced with the perforce change list description as if the --diff-only option was not used.

What operating system are you using?

MS Windows 7

Attach the debug out from the command.

$ rbt post --diff-only --debug 660124
>>> RBTools 0.7.4
>>> Python 2.7.2 (default, Jun 24 2011, 12:21:10) [MSC v.1500 32 bit (Intel)]
>>> Running on Windows-7-6.1.7601-SP1
>>> Home = C:\Users\sallan\AppData\Roaming
>>> Current directory = d:\tc-steps\TFS478505
>>> Running: git version
>>> Checking for a Perforce repository...
>>> Running: p4 info
>>> Running: diff --version
>>> repository info: Path: XXXXXX Base path: None, Supports changesets: True
>>> Making HTTP GET request to http://reviewboard/api/
>>> Running: p4 info
Generating diff for pending changeset 660124
>>> Processing edit of //depot/private/sallan/tc-steps/TFS478505/label.py
>>> Writing "//depot/private/sallan/tc-steps/TFS478505/label.py#2" to "c:\users\sallan\appdata\local\temp\tmpzch7sd"
>>> Running: p4 print -o c:\users\sallan\appdata\local\temp\tmpzch7sd -q //depot/private/sallan/tc-steps/TFS478505/label.py#2
>>> Running: diff -urNp c:\users\sallan\appdata\local\temp\tmpzch7sd D:/tc-steps\TFS478505\label.py
>>> Command exited with rc 1: [u'diff', u'-urNp', 'c:\\users\\sallan\\appdata\\local\\temp\\tmpzch7sd', 'D:/tc-steps\\TFS478505\\l
abel.py']
>>> Making HTTP GET request to http://reviewboard/api/validation/diffs/
>>> Cached response for HTTP GET http://reviewboard/api/validation/diffs/ expired and was modified
>>> Making HTTP POST request to http://reviewboard/api/validation/diffs/
>>> Making HTTP GET request to http://reviewboard/api/review-requests/?only-links=create&only-fields=
>>> Cached response for HTTP GET http://reviewboard/api/review-requests/?only-links=create&only-fields= expired and was modified
>>> Making HTTP POST request to http://reviewboard/api/review-requests/
>>> Got API Error 204 (HTTP code 409): The commit ID specified has already been used.
>>> Error data: {u'stat': u'fail', u'review_request': {u'status': u'pending', u'last_updated': u'2016-03-15T15:35:52Z', u'target_p
eople': [{u'href': u'http://reviewboard/api/users/sallan/', u'method': u'GET', u'title': u'sallan'}], u'depends_on': [], u'descrip
tion_text_type': u'markdown', u'issue_resolved_count': 0, u'ship_it_count': 0, u'close_description_text_type': u'plain', u'id': 12
9735, u'description': u"I'm adding this comment for Rev 2. Using --diff-only, this text should not appear in ReviewBoard.\n\nI'm o
penening a bug for this with the RBTools maintainers. This description is being typed directly into the description field in RB.
When I run post --diff-only, this text will be replaced with the text in the perforce change list.", u'links': {u'diffs': {u'href'
: u'http://reviewboard/api/review-requests/129735/diffs/', u'method': u'GET'}, u'repository': {u'href': u'http://reviewboard/api/r
epositories/71/', u'method': u'GET', u'title': u'dvp4edgepl005-broker'}, u'changes': {u'href': u'http://reviewboard/api/review-req
uests/129735/changes/', u'method': u'GET'}, u'self': {u'href': u'http://reviewboard/api/review-requests/129735/', u'method': u'GET
'}, u'update': {u'href': u'http://reviewboard/api/review-requests/129735/', u'method': u'PUT'}, u'last_update': {u'href': u'http:/
/reviewboard/api/review-requests/129735/last-update/', u'method': u'GET'}, u'reviews': {u'href': u'http://reviewboard/api/review-r
equests/129735/reviews/', u'method': u'GET'}, u'draft': {u'href': u'http://reviewboard/api/review-requests/129735/draft/', u'metho
d': u'GET'}, u'file_attachments': {u'href': u'http://reviewboard/api/review-requests/129735/file-attachments/', u'method': u'GET'}
, u'submitter': {u'href': u'http://reviewboard/api/users/sallan/', u'method': u'GET', u'title': u'sallan'}, u'delete': {u'href': u
'http://reviewboard/api/review-requests/129735/', u'method': u'DELETE'}, u'screenshots': {u'href': u'http://reviewboard/api/review
-requests/129735/screenshots/', u'method': u'GET'}, u'diff_context': {u'href': u'http://reviewboard/api/review-requests/129735/dif
f-context/', u'method': u'GET'}}, u'changenum': 660124, u'bugs_closed': [], u'testing_done_text_type': u'markdown', u'testing_done
': u'No testing.\nNo comment.', u'close_description': None, u'time_added': u'2016-03-10T16:58:29Z', u'extra_data': {}, u'public':
True, u'commit_id': u'660124', u'blocks': [], u'branch': u'', u'text_type': None, u'issue_open_count': 0, u'approved': False, u'ur
l': u'/r/129735/', u'absolute_url': u'http://reviewboard/r/129735/', u'target_groups': [], u'summary': u'Bogus review request to t
est --diff-only option', u'issue_dropped_count': 0, u'approval_failure': u'The review request has not been marked "Ship It!"'}, u'
err': {u'msg': u'The commit ID specified has already been used.', u'code': 204}}
>>> Making HTTP GET request to http://reviewboard/api/review-requests/129735/?only-links=diffs%2Cdraft&only-fields=absolute_url%2C
bugs_closed%2Cid%2Cstatus
>>> Cached response for HTTP GET http://reviewboard/api/review-requests/129735/?only-links=diffs%2Cdraft&only-fields=absolute_url%
2Cbugs_closed%2Cid%2Cstatus expired and was modified
>>> Making HTTP GET request to http://reviewboard/api/review-requests/129735/diffs/?only-fields=
>>> Cached response for HTTP GET http://reviewboard/api/review-requests/129735/diffs/?only-fields= expired and was modified
>>> Making HTTP POST request to http://reviewboard/api/review-requests/129735/diffs/
>>> Making HTTP GET request to http://reviewboard/api/review-requests/129735/draft/?only-fields=commit_id
>>> Cached response for HTTP GET http://reviewboard/api/review-requests/129735/draft/?only-fields=commit_id expired and was modifi
ed
>>> Fetching description for changelist 660124
>>> Making HTTP PUT request to http://reviewboard/api/review-requests/129735/draft/
Review request #129735 posted.

http://reviewboard/r/129735/
http://reviewboard/r/129735/diff/

Note the description field in the debug output with the text I typed in by hand in ReviewBoard. That was all replaced with the first line of the perforce change list descrition text:

$ p4 change -o 660124

Description:
Bogus review request to test --diff-only option

       I'm adding this comment for Rev 2. Using --diff-only, this text should not appear in ReviewBoard

Oddly enough, it only used the first line and did not include "I'm adding this comment..." text.

Please provide any additional information below.