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

RE: [PATCH] [merge-tracking] Code clarity fix

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2006-09-06 18:33:03 CEST

//Takes care of in1 = [0, 10] in2 = [4, 7]
  else if (in1->start <= in2->start
         && in1->end >= in2->start)
{
(*output)->start = in1->start;
(*output)->end = MAX(in1->end, in2->end);
return TRUE;
}
//Takes care of in1= [1, 3] in2 = [0, 10]

else if (in2->start <= in1->start
          && in2->end >= in1->start)
 {
 (*output)->start = in2->start;
 (*output)->end = MAX(in1->end, in2->end);
 return TRUE;
 }

The code that is removed by the patch try to handle revert ranges which should be a no-op.

With regards
Kamesh Jayachandran

-----Original Message-----
From: Daniel Berlin [mailto:dberlin@dberlin.org]
Sent: Wed 06/09/2006 19:32
To: Kamesh Jayachandran
Cc: Daniel Rall; SVN Dev
Subject: Re: [PATCH] [merge-tracking] Code clarity fix
 
> >
> > [[[
> > Patch by: Kamesh Jayachandran <kamesh@collab.net>
> >
> > Combining the revert ranges is undefined.
> >
> > * subversion/libsvn_subr/mergeinfo.c
> > (combine_ranges):
> > Combining the revert ranges is undefined.
> > ]]]
> >
> > ------------------------------------------------------------------------
> >

I'm not sure what you think this patch does, but it's not right to
remove these cases.

The cases below that you are removing combine ranges in case you have
the following:

in1 = [0, 10]
in2 = [4, 7]
and
in1= [1, 3]
in2 = [0, 10]

In both cases, one range completely subsumes the other, so we just use
one of the ranges.

It has nothing to do with revert ranges.

> > Index: subversion/libsvn_subr/mergeinfo.c
> > ===================================================================
> > --- subversion/libsvn_subr/mergeinfo.c (revision 21340)
> > +++ subversion/libsvn_subr/mergeinfo.c (working copy)
> > @@ -73,20 +73,6 @@
> > (*output)->end = MAX(in1->end, in2->end);
> > return TRUE;
> > }
> > - else if (in1->start >= in2->start
> > - && in1->end <= in2->end)
> > - {
> > - (*output)->start = in2->start;
> > - (*output)->end = in2->end;
> > - return TRUE;
> > - }
> > - else if (in2->start >= in1->start
> > - && in2->end <= in1->end)
> > - {
> > - (*output)->start = in1->start;
> > - (*output)->end = in1->end;
> > - return TRUE;
> > - }
> >
> > return FALSE;
Received on Wed Sep 6 18:53:21 2006

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