Use the original file name from the parent diff for files that are moved by the parent diff.

Review Request #9637 — Created Feb. 14, 2018 and discarded

Information

Review Board
release-3.0.x

Reviewers

If a file is modified in the current diff and renamed / moved in the parent
diff, we have to use the file name from the parent diff as source file in
diffutils.get_original_file() otherwise the file diff will not be displayed
correctly.

This fixes bug 4573.

Testing done:
In a local Mercurial project, created a changeset that moves a file, and
subsequently a changeset the modifies the moved file. Created a review for
the second changeset using rbt post.
Without the fix, the diff for the file is not displayed because the source
file cannot be found.
With the fix, the diff is displayed correctly.

A similar test has been performed by creating a copy of an existing file
in the first changeset.

Description From Last Updated

Strange... I just clicked the menu button on mobile Firefox multiple times because it did not open. Looks like it …

miserymisery

parent_diff contains UTF-8-encoded data. Without this conversion line 222 can throw an exception: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 …

GI giorgiob
GI
GI
GI
GI
GI
  1. 
      
  2. reviewboard/diffviewer/diffutils.py (Diff revisions 3 - 4)
     
     
    Show all issues

    parent_diff contains UTF-8-encoded data.

    Without this conversion line 222 can throw an exception: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position ...: ordinal not in range(128)
    I suppose the "in" operator in

    from_prefix in l
    

    tries to decode the string l as ASCII, but I am not sure if this is the case and how to avoid it.

    A better solution would be welcome.

  3. 
      
misery
  1. 
      
  2. Ping! Could someone review this? :-)

  3. 
      
GI
misery
  1. 
      
  2. Anyone?

  3. 
      
misery
  1. 
      
  2. 
      
misery
  1. 
      
  2. 
      
misery
  1. 
      
  2. 
      
misery
  1. 
      
  2. 
      
misery
  1. 
      
  2. 
      
misery
  1. 
      
  2. 
      
misery
  1. 
      
  2. Show all issues

    Strange... I just clicked the menu button on mobile Firefox multiple times because it did not open. Looks like it sends some comments for this.

    Nevertheless... this can be closed as it is fixed by /r/11099/

  3. 
      
david
Review request changed

Status: Discarded

Loading...