[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#271766: wiggle: Wiggle adds strange bogus conflict to merged file



Package: wiggle
Version: 0.6-4
Severity: normal


Hi,

I used wiggle to apply a .rej file, which it largely did succesfully;
however it _also_ added conflict markers claiming that every line in the
file from the end of the last successfully applied hunk to the end of
the source file was a `conflict'.

The status messages wiggle outputs also indicate that it did something funny.

Here's what I did to aplpy the .rej file, xfaces.c.rej, to xfaces.c,
using diff to construct a patch from wiggles changes:

   $ wiggle xfaces.c xfaces.c.rej | diff -u xfaces.c - > xfaces.c.wiggle-changes
   1 unresolved conflict found
   1 already-applied change ignored

The "1 already-applied change ignored" message was expected -- a single
line in the middle of the hunk was "already applied" (which probably is
what caused patch to reject the hunk in the first place).  However the
unresolved conflict was not, and turns out to be completely bogus.

I haven't included the source file (xfaces.c) because it's very large,
but will do on request.


First the .rej file, xfaces.c.rej: --------------------------------------


@@ -4503,29 +4508,45 @@
       XSETFRAME (frame, f);
       call1 (Qframe_update_face_colors, frame);
 
-      lface = lface_from_face_name (f, Qdefault, 1);
+      face = Qdefault;
+      lface = lface_from_face_name (f, face, 1);
       LFACE_BACKGROUND (lface) = (STRINGP (new_value)
 				  ? new_value : Qunspecified);
       realize_basic_faces (f);
     }
-  if (EQ (param, Qborder_color))
+  else if (EQ (param, Qborder_color))
     {
-      lface = lface_from_face_name (f, Qborder, 1);
+      face = Qborder;
+      lface = lface_from_face_name (f, face, 1);
       LFACE_BACKGROUND (lface) = (STRINGP (new_value)
 				  ? new_value : Qunspecified);
     }
   else if (EQ (param, Qcursor_color))
     {
-      lface = lface_from_face_name (f, Qcursor, 1);
+      face = Qcursor;
+      lface = lface_from_face_name (f, face, 1);
       LFACE_BACKGROUND (lface) = (STRINGP (new_value)
 				  ? new_value : Qunspecified);
     }
   else if (EQ (param, Qmouse_color))
     {
-      lface = lface_from_face_name (f, Qmouse, 1);
+      face = Qmouse;
+      lface = lface_from_face_name (f, face, 1);
       LFACE_BACKGROUND (lface) = (STRINGP (new_value)
 				  ? new_value : Qunspecified);
     }
+
+  /* Changing a named face means that all realized faces depending on
+     that face are invalid.  Since we cannot tell which realized faces
+     depend on the face, make sure they are all removed.  This is done
+     by incrementing face_change_count.  The next call to
+     init_iterator will then free realized faces.  */
+  if (!NILP (face)
+      && NILP (Fget (face, Qface_no_inherit)))
+    {
+      ++face_change_count;
+      ++windows_or_buffers_changed;
+    }
 }
 
 
  
  
Now the changes wiggle made, xface.c.wiggle-changes: ----------------------


--- xfaces.c	2004-09-15 14:39:24 +0900
+++ -	2004-09-15 14:53:08 +0900
@@ -4523,32 +4523,48 @@
       XSETFRAME (frame, f);
       call1 (Qframe_update_face_colors, frame);
 
-      lface = lface_from_face_name (f, Qdefault, 1);
+      face = Qdefault;
+      lface = lface_from_face_name (f, face, 1);
       LFACE_BACKGROUND (lface) = (valid_tile_p (new_value)
 				  ? new_value : Qunspecified);
       realize_basic_faces (f);
     }
   else if (EQ (param, Qborder_color))
     {
-      lface = lface_from_face_name (f, Qborder, 1);
+      face = Qborder;
+      lface = lface_from_face_name (f, face, 1);
       LFACE_BACKGROUND (lface) = (STRINGP (new_value)
 				  ? new_value : Qunspecified);
     }
   else if (EQ (param, Qcursor_color))
     {
-      lface = lface_from_face_name (f, Qcursor, 1);
+      face = Qcursor;
+      lface = lface_from_face_name (f, face, 1);
       LFACE_BACKGROUND (lface) = (STRINGP (new_value)
 				  ? new_value : Qunspecified);
     }
   else if (EQ (param, Qmouse_color))
     {
-      lface = lface_from_face_name (f, Qmouse, 1);
+      face = Qmouse;
+      lface = lface_from_face_name (f, face, 1);
       LFACE_BACKGROUND (lface) = (STRINGP (new_value)
 				  ? new_value : Qunspecified);
     }
-}
 
+  /* Changing a named face means that all realized faces depending on
+     that face are invalid.  Since we cannot tell which realized faces
+     depend on the face, make sure they are all removed.  This is done
+     by incrementing face_change_count.  The next call to
+     init_iterator will then free realized faces.  */
+  if (!NILP (face)
+      && NILP (Fget (face, Qface_no_inherit)))
+    {
+      ++face_change_count;
+      ++windows_or_buffers_changed;
+    }
+}
 
+<<<<<<<
 /* Get the value of X resource RESOURCE, class CLASS for the display
    of frame FRAME.  This is here because ordinary `x-get-resource'
    doesn't take a frame argument.  */
@@ -8058,3 +8074,7 @@
 
 /* arch-tag: 8a0f7598-5517-408d-9ab3-1da6fcd4c749
    (do not change this comment) */
+|||||||
+=======
+
+>>>>>>>



----------------------------------------------------------------

Note that other than the single "if" changed to "else if" in the of the
hunk (which was the duplicate wiggle resolved), and the bogus conflict
at the end of the wiggle changes, they are the same.

BTW, I briefly tried to reproduce this with much smaller files, but
wiggle worked fine on them... :-/

Thanks,

-Miles


-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (101, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.8.1
Locale: LANG=C, LC_CTYPE=C

Versions of packages wiggle depends on:
ii  libc6                       2.3.2.ds1-16 GNU C Library: Shared libraries an

-- no debconf information



Reply to: