On Tue, Apr 5, 2011 at 6:39 PM, su heng <ste.suheng_at_gmail.com> wrote:
> On Tue, 2011-04-05 at 09:16 +0200, Jan Keirse wrote:
>> > Hi Jan,
>> >
>> > I just try the example which you provided to me. Please refer to
>> my
>> > flow:
>> > ###############
>> > step 1
>> > submit one file possat:
>> > --------------
>> > brand=vw
>> > model=possat
>> > tires=4
>> > engine=1900
>> > horsepower=110
>> > ---------------
>> >
>> > file name:possat(possat_at_r159)
>> > ################
>> > step 2
>> > create branch octevia(possat_at_r160) and somesiat(possat_at_r161) base on
>> > file possat
>> > ################
>> > step 3
>> > change file possat under somesiat branch (possat_at_r161)
>> > --------------------
>> > brand=siat
>> > model=somesiat
>> > tires=4
>> > engine=1900
>> > horsepower=110
>> > ---------------------
>> > and submit can get (possat_at_r162)
>> >
>> > change file possat under octevia branch:
>> > ----------------
>> > brand=skida
>> > model=octevia
>> > tires=4
>> > engine=1900
>> > horsepower=110
>> > ----------------
>> > and submit can get (possat_at_r163)
>> >
>> > ######################
>> > step 4
>> > change possat under trunk(possat_at_r161)
>> > --------------
>> > brand=vw
>> > model=possat
>> > tires=5
>> > engine=1900
>> > horsepower=110
>> > ---------------
>> > and submit can get (possat_at_r164)
>> >
>> >
>> > Now, I switch to branch possat or octevia, do merge from trunk.
>> > the line 'tires=5' will be merge automatically to my branch possat
>> or
>> > octevia.
>> >
>> >
>> > Strange thing, if I switch to trunk do merge from possat or octevia,
>> > brand line and model line will be automatically overwrite trunk's
>> lines.
>>
>> No, step 4 is not what I described, if you do it that way SVN will
>> handle it properly because it knows what changed where (only line 3
>> changed in the trunk and line 3 was not changed in the branches so it
>> won't give a conflict).
>> The thing I described was that you no longer care about trunk, the car
>> is no longer made so the engineers don't fix the file. They only fix
>> the Octevia and Siat. So you leave trunk as it was, with 4 tires,
>> delete the file if you want, but fix the somesiat branch and merge
>> from the somesiat branch to the Octevia branch.
>>
>>
>> Kind Regards,
>>
>> JAN KEIRSE
>> **** DISCLAIMER ****
>>
>> http://www.tvh.com/newen2/emaildisclaimer/default.html
>>
>> "This message is delivered to all addressees subject to the conditions
>> set forth in the attached disclaimer, which is an integral part of
>> this
>> message."
> Hi Jan & Bob,
>
> Got it, so If we merge different changes(on one or more same lines)
> under same file, we will encounter the conflict and it is the basic and
> only rule of text conflict, right?
I don't think that's the only rule for text conflicts. A conflict can
also happen if too much of the context around the "target line" has
changed. I don't know the exact rules here (or even whether or not
they are documented somewhere), but intuitively: if svn can't find the
old version of the line anymore (either because it has changed itself,
or too many lines around it have changed), it cannot be sure where to
"apply" the line-change, so it will give a conflict.
It's actually quite similar to what the unix "patch" command does,
when trying to apply a diff to a file. The unix patch command can also
fail under certain circumstances (with "rejected hunks"), if it can't
find where to apply those particular "hunks".
Cheers,
--
Johan
Received on 2011-04-05 20:54:00 CEST