[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Mismerge case

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2005-08-10 20:46:37 CEST

In http://lists.zooko.com/pipermail/revctrl/2005-August/000049.html,
zooko identified a mismerge case with Subversion. I'll append the
three files below.

The case is perhaps a little unfair to Subversion, because it relies
on a situation where Subversion's internal diff produces a funny (but
valid) diff between ancestor and target1:

  --- init (.../init) (revision 1)
  +++ init (.../1) (revision 1)
  @@ -1,5 +1,10 @@
  -int square(int x) {
  +int fast_square(int x) {
           int y = x;
  + return y * x;
  +}
  +
  +int slow_square(int x) {
  + int y = x;
           for (int i = 0; i < x; i++) y += x;
           return y;
   }

while gnu diff happens to produce a more natural diff. However, I
think it's also the case that diff3 requires some unmodified context
between changed lines in order to perform a clean merge, and we are
not requiring any context, which is kind of unsafe. Can anyone more
knowledgeable about libsvn_diff speak to that?

--- Ancestor ---
int square(int x) {
        int y = x;
        for (int i = 0; i < x; i++) y += x;
        return y;
}
----------------

--- Target 1 ---
int fast_square(int x) {
        int y = x;
        return y * x;
}

int slow_square(int x) {
        int y = x;
        for (int i = 0; i < x; i++) y += x;
        return y;
}
----------------

--- Target 2 ---
int square(int x) {
        int y = 0;
        for (int i = 0; i < x; i++) y += x;
        return y;
}
----------------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Aug 10 20:47:51 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.