3172: Review Board diff is not the same as perforce diff after files are moved and resolved

gilbe*****@gmai***** (Google Code) (Is this you? Claim this profile.)
What version are you running?
Review Board 1.7.14


What's the URL of the page containing the problem?
localhost:/r/111/diff/#index_header

Essentially the problem occurs when we upload a diff with post-review, so
this is a post-review bug as far as we can tell, not a review board server bug.

What steps will reproduce the problem?
1. Using perforce Move file dir1/X.c#10 to new location dir2/X.c#1
2. Another user submits a change to dir1/X.c#10 to dir1/X.c#11 on server
3. In local workspace resolve dir2/X.c#1 to get #11 changes, p4 does this correctly
4. Create review request with post-review
5. Diff uploaded will always be against #10, even though file was correctly resolved

A workaround exists, but it is complicated and painful:

1. Move file dir2/X.c to the original location at dir1/X.c
2. Revert file dir1/X.c to get the latest version #11
3. Open the file dir1/X.c#11 again
4. Move the file dir1/X.c#11 to the new location dir2/X.c#1
5. Re-apply your changes
6. Create a review request with post-review

Note that perforce creates the correct .diff when asked to after
resolving the local workspace without this workaround.

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

Expect post-review to create the same diff that p4 would create.

Instead post-review doesn't seem to understand that the file in the
new location has been properly resolved, and shows the difference against
an older version, essentially the version of the file prior to the move.

What operating system are you using? What browser?

Not a browser related problem or an OS related problem, problem exists 
in post-review and the .diff files it creates.

Please provide any additional information below.

Moving files is an uncommon operation, but whenever we try to create a .diff
for review that involves files that move it seems as though the developer
is adding changes that are actually added by other developers as the patch ages. 
The bug is confusing, and only occurs in the most complicated patches.
david
#1 david
  • +Component-RBTools
chipx86
#2 chipx86
  • +Project-RBTools
david
#3 david
  • -reviewboard
    +rbtools
  • -Project:RBTools