4052: Interdiff from deleted to modified file shows file as deleted

smacleod
smacleod

What version are you running?

2.5.2

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

https://reviewboard.mozilla.org/r/29831/diff/1-2/

What steps will reproduce the problem?

  1. Create a diff revision which removes a file (r1)
  2. Publish
  3. Create a new diff revision which doesn't remove the file, but modifies it. (r2)
  4. View the interdiff between the two revisions

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

Expected: Interdiff showing add lines for the contents of the file in (r2).
Instead: Interdiff shows that the file was removed.

Diff set information:

Diff Set Revision 1:
Generated From: https://reviewboard-hg.mozilla.org/gecko/rev/dcf453bcead9
ID: 64881
Differ Compatibility Version: 2
Commit ID: 9d013a40a75073665fe86ff02b0558f0e078bac0
Extra Data: {}
Relevant File Diff:
ID: 518509
Status: Deleted
Source File: dom/html/test/file_fullscreen-api-keys.html
Source File Revision: UNKNOWN
Destination File: dom/html/test/file_fullscreen-api-keys.html
Destination File Details:
Diff: filediff-518509.diff attached
Extra Data: {"orig_sha1": "ff9c2f6f5c8e6ec42b4a117c4be5f5994724f4a7", "total_line_count": 129, "patched_sha1": "da39a3ee5e6b4b0d3255bfef95601890afd80709", "raw_delete_count": 129, "delete_count": 129, "replace_count": 0, "raw_insert_count": 0, "insert_count": 0, "equal_count": 0}

Diff Set Revision 2:
Generated From: https://reviewboard-hg.mozilla.org/gecko/rev/30ede73c4b96
ID: 65417
Differ Compatibility Version: 2
Commit ID: 5c5196bdd8252d52c0504dc1fdbb178e92d50dd0
Extra Data: {}
Relevant File Diff:
ID: 520857
Status: Modified
Source File: dom/html/test/file_fullscreen-api-keys.html
Source File Revision: UNKNOWN
Destination File: dom/html/test/file_fullscreen-api-keys.html
Destination File Details:
Diff: filediff-520857.diff attached
Extra Data: {"orig_sha1": "ff9c2f6f5c8e6ec42b4a117c4be5f5994724f4a7", "total_line_count": 132, "patched_sha1": "f8377baf538284b1715ea28c3a9f44ffaa258f25", "raw_delete_count": 107, "delete_count": 100, "replace_count": 7, "raw_insert_count": 10, "insert_count": 3, "equal_count": 22}

diff --git a/dom/html/test/file_fullscreen-api-keys.html b/dom/html/test/file_fullscreen-api-keys.html
deleted file mode 100644
--- a/dom/html/test/file_fullscreen-api-keys.html
+++ /dev/null
@@ -1,129 +0,0 @@
- <!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=545812
-
-Test that restricted key pressed drop documents out of DOM full-screen mode.
-
--->
-<head>
-  <title>Test for Bug 545812</title>
-  <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
-  <script type="application/javascript" src="file_fullscreen-utils.js"></script>
-  <style>
-  body {
-    background-color: black;
-  }
-  </style>
-</head>
-<body>
-
-<script type="application/javascript">
-
-/** Test for Bug 545812 **/
-
-// List of key codes which should exit full-screen mode.
-var keyList = [
-  { code: "VK_ESCAPE", suppressed: true},
-  { code: "VK_F11",    suppressed: false},
-];
-
-function ok(condition, msg) {
-  opener.ok(condition, "[keys] " + msg);
diff --git a/dom/html/test/file_fullscreen-api-keys.html b/dom/html/test/file_fullscreen-api-keys.html
--- a/dom/html/test/file_fullscreen-api-keys.html
+++ b/dom/html/test/file_fullscreen-api-keys.html
@@ -1,129 +1,32 @@
- <!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=545812
-
-Test that restricted key pressed drop documents out of DOM full-screen mode.
-
--->
+<!DOCTYPE html>
+<html lang="en">
 <head>
-  <title>Test for Bug 545812</title>
-  <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
-  <script type="application/javascript" src="file_fullscreen-utils.js"></script>
-  <style>
-  body {
-    background-color: black;
-  }
-  </style>
+  <meta charset="UTF-8">
 </head>
 <body>
+<script>
+window.addEventListener("Test:DispatchKeyEvents", aEvent => {
+  var keyCode = KeyEvent["DOM_" + aEvent.detail.code];
-<script type="application/javascript">
-
-/** Test for Bug 545812 **/
-
-// List of key codes which should exit 
#1 smacleod

I'm working on this, wish me luck.

  • -New
    +Started
  • +Release-2.5.x
  • -Priority:Medium
    +Component:DiffViewer
    +Interdiffs
    +Priority:High
  • +smacleod
#2 smacleod
  • -Started
    +PendingReview
#3 smacleod

So a bit of a status update for this bug, it actually has several layers to it:
1. Taking the interdiff into account when deciding if the file is deleted.
2. Properly marking this case as a new file in the interdiff
3. Fixing the opcode processor to stop filtering this case as all "filtered equal" chunks.

The code I've posted in https://reviews.reviewboard.org/r/7874/ takes care of (1), I have a patch ready for (2) as well, but (3) is much more difficult and may take a little time for me to get a handle on - I'm still working on it.