how to avoid text and tree conflict

2011-04-04 Thread su heng
Hi,

  I read the SVN book, as there are three type conflicts: text, tree and
properties conflict. However, I wanna know why it is a conflict. For
example, if there is a text conflict when I do merging code, I just know
there is an conflict but don't know why it is a conflict.

  So could u provide me some resource or hints what are the judge rules
for SVN to address it is a conflict, in this case, I can avoid more
conflict when I'm coding or merging. I concert the text and tree
conflict more.

Regards,
Su Heng

-- 
QQ :49757862
MSN:suh.ste...@hotmail.com
Mobile: (0512)60780554




Re: Betr.: how to avoid text and tree conflict

2011-04-04 Thread su heng
Hi Jan,

  Please kindly refer to my below comments.

Regards,
Su Heng

On Mon, 2011-04-04 at 16:03 +0200, Jan Keirse wrote:
> su heng  schreef op 04/04/2011 15:41:38:
> 
> > Hi,
> > 
> >   I read the SVN book, as there are three type conflicts: text, tree and
> > properties conflict. However, I wanna know why it is a conflict. For
> > example, if there is a text conflict when I do merging code, I just know
> > there is an conflict but don't know why it is a conflict.
> > 
> >   So could u provide me some resource or hints what are the judge rules
> > for SVN to address it is a conflict, in this case, I can avoid more
> > conflict when I'm coding or merging. I concert the text and tree
> > conflict more.
> > 
> 
> Start version is A. B and C are changes to A.
> Change B says line 3 is 'cool!'
> Change C says line 3 is 'boring!'
> If you want to merge change B and C there's a conflict, because one change 
> says the opposite of the other. 
[suheng] : thanks, However, your example just covers one condition. Can
you give me a basic conflict rule policy of SVN so I can conclude all
conditions?
  As your example, can I thought whenever a low revision(C) merge to a
high revision(when B merge to A, A will be A+1), a text conflict will be
pop up whatever the line is changed?
  In your example, the precondition is file a is revision A, then the
same file under change B is revision B = A + n(n>0), and same file under
change C is revision C = B + n(n>0), when change B is merged to A, we
must commit it firstly(at this time revision A will be rise to A+n > B
&& A+n > C, then do another merge I mean change C will be merged in A+n,
then conflict out.
  I think if C is a branch of from revision B+n(n>1) but not A, when we
merge C+n(n>1) won't involve conflict, right?

  Hmm...I think it has little confusing. you can ignore my explain, just
suggest me the basic conflict policy is appreciated.^_^

> 
> Similar: 
> Start filename is A . 
> Change B says A should be renamed to B. 
> Change C says A should be renamed to C.
> If you want to merge B and C what should the filename be? B or C? 
[suheng] : thanks for your explain.
> 
> Kind Regards,
> 
> JAN KEIRSE
> ICT-AFDELING ? software quality & systems ? software engineer
> 
>  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."
> 


-- 
QQ :49757862
MSN:suh.ste...@hotmail.com
Mobile: (0512)60780554




Re: Betr.: Re: Betr.: how to avoid text and tree conflict

2011-04-04 Thread su heng
On Mon, 2011-04-04 at 17:37 +0200, Jan Keirse wrote:
> su heng  schreef op 04/04/2011 16:31:17:
> 
> > Hi Jan,
> > 
> >   Please kindly refer to my below comments.
> > 
> > Regards,
> > Su Heng
> > 
> > On Mon, 2011-04-04 at 16:03 +0200, Jan Keirse wrote:
> > > su heng  schreef op 04/04/2011 15:41:38:
> > > 
> > > > Hi,
> > > > 
> > > >   I read the SVN book, as there are three type conflicts: text, tree 
> and
> > > > properties conflict. However, I wanna know why it is a conflict. For
> > > > example, if there is a text conflict when I do merging code, I just 
> know
> > > > there is an conflict but don't know why it is a conflict.
> > > > 
> > > >   So could u provide me some resource or hints what are the judge 
> rules
> > > > for SVN to address it is a conflict, in this case, I can avoid more
> > > > conflict when I'm coding or merging. I concert the text and tree
> > > > conflict more.
> > > > 
> > > 
> > > Start version is A. B and C are changes to A.
> > > Change B says line 3 is 'cool!'
> > > Change C says line 3 is 'boring!'
> > > If you want to merge change B and C there's a conflict, because one 
> change 
> > > says the opposite of the other. 
> > [suheng] : thanks, However, your example just covers one condition. Can
> > you give me a basic conflict rule policy of SVN so I can conclude all
> > conditions?
> >   As your example, can I thought whenever a low revision(C) merge to a
> > high revision(when B merge to A, A will be A+1), a text conflict will be
> > pop up whatever the line is changed?
> >   In your example, the precondition is file a is revision A, then the
> > same file under change B is revision B = A + n(n>0), and same file under
> > change C is revision C = B + n(n>0), when change B is merged to A, we
> > must commit it firstly(at this time revision A will be rise to A+n > B
> > && A+n > C, then do another merge I mean change C will be merged in A+n,
> > then conflict out.
> >   I think if C is a branch of from revision B+n(n>1) but not A, when we
> > merge C+n(n>1) won't involve conflict, right?
> > 
> >   Hmm...I think it has little confusing. you can ignore my explain, just
> > suggest me the basic conflict policy is appreciated.^_^
> 
> Ok, you misunderstood, C has nothing to do with B, it does not come after 
> B. As a general rule: if you changed the same line there is a conflict.
> 
> I'll put it another way. 
> Imagine at some point velkswagen makes a car, and stores the information 
> about that car in a file, named possat.txt.
> The file could have the following contents:
> 
> ---
> brand=vw
> model=possat
> tires=4
> engine=1900
> horsepower=110
> ---
> 
> Now at some point VW decides there possat can be sold with another logo as 
> skida octevia. So they branch the file:
>octevia
>   /
> possat
> 
> And the file becomes:
> ---
> brand=skida
> model=octevia
> tires=4
> engine=1900
> horsepower=110
> ---
> 
> 
> After a few more years they decide to sell the same car under the siat 
> Brand:
> 
>octevia
>   /
> possat
>   \
>  somesiat
> 
> 
> ---
> brand=siat
> model=somesiat
> tires=4
> engine=1900
> horsepower=110
> ---
> 
> Now a clever engineer at siat notices that a car does not have 4 tires but 
> 5, in case you hit a nail along the road you get an extra one in the trunk 
> to get you home. So he changes tires to 5. 
> Now we have 3 files, possat, somesiat and octevia. They all share the same 
> origin, the possat is long out of production so we don't care about that 
> anymore, but we want the octevia fixed. 
> If you merge from somesiat to octevia, with the possat as mutual ancestor, 
> you're going to get a problem, not with the tires but with the brand and 
> model, because somesiat changed brand and model but octevia did as well, 
> who holds the truth, what brand and model should be in the octevia file? 
> 
> 
> Kind Regards,
> 
> JAN KEIRSE
> ICT-AFDELING • software quality & systems • software engineer
> 
>  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
> mess

RE: how to avoid text and tree conflict

2011-04-04 Thread su heng
On Mon, 2011-04-04 at 10:26 -0400, Bob Archer wrote:
> >   I read the SVN book, as there are three type conflicts: text,
> > tree and
> > properties conflict. However, I wanna know why it is a conflict.
> > For
> > example, if there is a text conflict when I do merging code, I just
> > know
> > there is an conflict but don't know why it is a conflict.
> 
> It is a conflict because two people changed the same line of code. So, the 
> software can't know which line of code you want to remain after it merges 
> them... you have to tell it. You could choose one line, the other line, or 
> even combine them in some way.
> 
> BOb
> 
> 
> 
> > 
> >   So could u provide me some resource or hints what are the judge
> > rules
> > for SVN to address it is a conflict, in this case, I can avoid more
> > conflict when I'm coding or merging. I concert the text and tree
> > conflict more.
> > 
> > Regards,
> > Su Heng
> > 
> > --
> > QQ :49757862
> > MSN:suh.ste...@hotmail.com
> > Mobile: (0512)60780554
> > 
> 

Hi Bob,

  What about different lines?
trunk file node@r1
node:
-
line1
-

create branch node1(node@r2), node2(node@r3)

edit node@r2 under branch node1
-
line1
line2
-
submit and get node@r3

edit node@r3 under branch node2
-
line1

line3
-
submit and get node@r4

edit node@r1(or merge branch node1) under trunk
-
line1
line2
-
submit and get node@r5

finally, merge branch node2@r4 to trunk can get conflict.

<<<<<<< .working
line1
line2===
line1

line3>>>>>>> .merge-right.r4


 I though node2@r4 will be merged to node@r5 like this:
-
line1
line2
line3
-

but not.



-- 
Regards,
Su Heng
MSN: suh.ste...@hotmail.com



Re: Betr.: Re: Betr.: Re: Betr.: how to avoid text and tree conflict

2011-04-05 Thread su heng
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@r159)
> > 
> > step 2
> > create branch octevia(possat@r160) and somesiat(possat@r161) base on
> > file possat
> > 
> > step 3
> > change file possat under somesiat branch (possat@r161)
> > 
> > brand=siat
> > model=somesiat
> > tires=4
> > engine=1900
> > horsepower=110
> > -
> > and submit can get (possat@r162)
> > 
> > change file possat under octevia branch:
> > 
> > brand=skida
> > model=octevia
> > tires=4
> > engine=1900
> > horsepower=110
> > 
> > and submit can get (possat@r163)
> > 
> > ##
> > step 4
> > change possat under trunk(possat@r161)
> > --
> > brand=vw
> > model=possat
> > tires=5
> > engine=1900
> > horsepower=110
> > ---
> > and submit can get (possat@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?

^_^ Thank you very much.


-- 
Regards,
Su Heng
MSN: suh.ste...@hotmail.com