Permalink
Browse files

Fix diff generation with unedited files in Perforce.

If you make a perforce-backed code review with an unedited (but opened)
file then ReviewBoard chokes on the empty diff content. Based on the
recentness of this issue I suspect that it's regression for us from
upgrading ReviewBoard from 1.5 to 1.6.

This issue has been discussed by others on...

http://code.google.com/p/reviewboard/issues/detail?id=2754

========================================

Steps to repro:

1. p4 edit some/file/with/stuff
2. run post-review

Expected:

Post-review should error out if you don't have any edits. If you have
other modifications then it should just make a code review with that.

Actual:

Post-review always succeeds, but the unedited file renders as a
stacktrace in ReviewBoard.

Fixes bug #2754
Reviewed at http://reviews.reviewboard.org/r/3944/
  • Loading branch information...
1 parent 5aac8d3 commit 74d0a4294f952cf6692b0b67b100122bcc3c1509 @atagar atagar committed with chipx86 Mar 14, 2013
Showing with 3 additions and 1 deletion.
  1. +1 −0 AUTHORS
  2. +2 −1 rbtools/clients/perforce.py
View
@@ -20,6 +20,7 @@ Contributors:
* Chris Clark
* Chris Liu
* Craig Silverstein
+ * Damian
* Dana Lacoste
* Daniel Cestari
* Daniel LaMotte
@@ -622,7 +622,8 @@ def _changenum_diff(self, changenum):
depot_path))
dl = self._do_diff(old_file, new_file, depot_path, base_revision,
- new_depot_path, changetype_short)
+ new_depot_path, changetype_short,
+ ignore_unmodified=True)
diff_lines += dl
os.unlink(empty_filename)

0 comments on commit 74d0a42

Please sign in to comment.