2369: post-review handling of added files in a Perforce changelist is wrong

Faller******@gmai***** (Google Code) (Is this you? Claim this profile.)
Jan. 22, 2012
What version are you running?
RBTools 0.3.3

What's the URL of the page containing the problem?
-

What steps will reproduce the problem?
1.post-review an old submitted change in a Perforce repo
2.
3.

What is the expected output? What do you see instead?
If the change has an added file, post-review will use its last revision for the diff, not the initial #1 revision. This file has a lot of improvements since the addition of it (=reviewed change).

What operating system are you using? What browser?
WinXP

Please provide any additional information below.
I noticed that the code snippet:
          elif changetype in ['add', 'branch', 'move/add']:
                # We have a new file, get p4 to put this new file into a pretty
                # temp file for us. No old file to worry about here.
                if cl_is_pending:
                    new_file = self._depot_to_local(depot_path)
                else:
                    self._write_file(depot_path, tmp_diff_to_filename)
                    new_file = tmp_diff_to_filename
                changetype_short = "A"

should be changed to (the depot path should be decorated with a #1):
          elif changetype in ['add', 'branch', 'move/add']:
                # We have a new file, get p4 to put this new file into a pretty
                # temp file for us. No old file to worry about here.
                if cl_is_pending:
                    new_file = self._depot_to_local(depot_path)
                else:
                    new_depot_path = "%s#%s" %(depot_path, 1)
                    self._write_file(new_depot_path, tmp_diff_to_filename)
                    new_file = tmp_diff_to_filename
                changetype_short = "A"

after the change the handling of additions work fine.
david
#1 david
Fixed in release-0.3.x (947cc35) and master (59a7ec5). Thanks!
  • +Fixed