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
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 … |
misery | |
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 |
- Bugs:
- Testing Done:
-
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. - Commit:
-
2f49189b0812711a66226ec418081070ccbd068938dc338e5f9b2b5f40c2ea035c6488c99a911575
- Diff:
-
Revision 2 (+31 -1)
Checks run (2 succeeded)
- Commit:
-
38dc338e5f9b2b5f40c2ea035c6488c99a911575c5e05d977a43f2968d622e875812f4741cea2399
- Diff:
-
Revision 3 (+34 -1)
Checks run (2 succeeded)
- Commit:
-
c5e05d977a43f2968d622e875812f4741cea23996bf59ad3411532f9e3d19aed76dd5937aa0d8bd5
- Diff:
-
Revision 4 (+34 -1)
Checks run (2 succeeded)
-
-
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 infrom_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.
- Commit:
-
6bf59ad3411532f9e3d19aed76dd5937aa0d8bd5fc7838e61a575c38994f7430cb6afd7ed76f708e
- Diff:
-
Revision 5 (+47 -1)