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

Re: Question on branching the right way

From: Simon Large <simon_at_skirridsystems.co.uk>
Date: 2006-04-06 11:58:46 CEST

Sascha Herpers wrote:
> Hello,
>
> yes, all of what you wrote is clear to me. But I still have the problem
> (no matter what direction the merge goes), that parts of the directory
> get overwritten, that shouldn't be overwritten.
>
> I guess the main problem is, that I can't explain it good enough. Let's
> try it with an example.
>
> In a fresh repository I created a file "text.txt" with one line:
> string myVersion;
> I commited it to the trunk and (afterwards) branched it. I added the
> following line to the trunk version and committed it again:
> myVersion = "trunk";
> Then I switched to the branch and applied and commit a similar change to
> the file:
> myVersion = "branch";
>
> Now comes the problem part. I decided to have another variable in both
> versions. Since I don't want to make the same change twice, I want to
> make it to the trunk and "somehow sync" the branch version.
>
> So I switched to the trunk and added a new line inbetween the two
> existing lines:
> int someInt;
>
> Now I call the merge command from tsvn. I specify to merge from branch
> to trunk. The unified diff shows the following:
> +int someInt;
>
> -myVersion = "custom";
> \ No newline at end of file
> +myVersion = "trunk";
> \ No newline at end of file
>
> Ok, my newly added variable "someInt" would be added to the branch. But
> the next changes are unwanted. The initialization of myVersion would be
> replaced by the trunk version.

Make smaller commits. Don't mix things which are specific to one branch
with something you want to merge into all branches in the same commit.

Instead of merging all revisions, just merge the ones with the changes
you want to copy across.

Simon

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: users-help@tortoisesvn.tigris.org
Received on Thu Apr 6 11:58:06 2006

This is an archived mail posted to the TortoiseSVN Users mailing list.