You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Craig White <cr...@azapple.com> on 2006/03/21 15:47:32 UTC

merging a branch to the trunk

Let me try to describe what I am trying to do in another way.

I want to merge my branch 'phase2' into my main trunk

I change directories to my main trunk
$ pwd
/home/craig/svn/th-db/trunk

svn merge --dry-run -r 1:20 svn \
+craigssh://craig@srv1.example.com/home/craig/svn/th-db/branches/phase2

but it 'appears' to me that it is creating everything new inside my
trunk...

Skipped 'test'
Skipped 'test/unit'
A    test/unit/client_test.rb
A    test/unit/user_test.rb
A    test/unit/notifier_test.rb
A    test/unit/clients_test.rb
A    test/unit/error_mailer_test.rb
A    test/unit/facility_test.rb
A    test/unit/case_manager_test.rb
A    test/unit/referral_note_test.rb
A    test/unit/case_managers_test.rb
A    test/unit/placement_test.rb
A    test/test_helper.rb

when all these files already exist in the 'trunk'

$ ls -l test
total 40
drwxr-xr-x  3 craig dom_users 4096 Mar 21 08:41 fixtures
drwxr-xr-x  3 craig dom_users 4096 Mar 21 08:41 functional
drwxr-xr-x  5 craig dom_users 4096 Mar 10 23:32 mocks
-rw-r--r--  1 craig dom_users 1317 Mar 10 23:32 test_helper.rb
drwxr-xr-x  3 craig dom_users 4096 Mar 21 08:41 unit

$ ls -l test/unit/
total 64
-rw-r--r--  1 craig dom_users 246 Mar 10 23:32 case_managers_test.rb
-rw-r--r--  1 craig dom_users 244 Mar 10 23:32 case_manager_test.rb
-rw-r--r--  1 craig dom_users 224 Mar 10 23:32 clients_test.rb
-rw-r--r--  1 craig dom_users 222 Mar 10 23:32 client_test.rb
-rw-r--r--  1 craig dom_users 232 Mar 10 23:32 facility_test.rb
-rw-r--r--  1 craig dom_users 234 Mar 10 23:32 placement_test.rb
-rw-r--r--  1 craig dom_users 248 Mar 10 23:32 referral_note_test.rb
-rw-r--r--  1 craig dom_users 214 Mar 10 23:32 user_test.rb

what is the way to do this?

Craig


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: merging a branch to the trunk

Posted by Craig White <cr...@azapple.com>.
On Tue, 2006-03-21 at 19:11 +0100, Oliver Pajonk wrote:
> 2006/3/21, Craig White <cr...@azapple.com>:
>         
>         after the merge, I've got...
>         
>         $ ls app/controllers/application.rb*
>         app/controllers/application.rb
>         app/controllers/application.rb.merge-left.r14
>         app/controllers/application.rb.working
>         app/controllers/application.rb.merge- right.r20
>         
>         and I'm certain that I want the revision 20 version. What is
>         the proper
>         way to handle this?
>         
> 
> The way is to edit "app/controllers/application.rb" so that it
> contains the version that you want (merging left and right is the
> obvious way, but as you definitely want r20, just copy it and
> overwrite "app/controllers/application.rb"). Then mark the conflict as
> "resolved" with something like: 
> 
> svn resolved app/controllers/application.rb
> 
> That will get rid of the "weird" files and just leave
> "app/controllers/application.rb" behind and remove the "conflict"
> status. Then you can just commit it and you're done. 
----
OK - svn resovled... perhaps I should have just done svn copy rather
than merge - assuming that all I wanted was the 'branch' in the 'trunk'
- I did change a couple of files in the 'trunk' after I branched because
I left some broken code in the trunk - sensing what I was doing, decided
that it would be better to branch.

Thanks

Craig


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: merging a branch to the trunk

Posted by Oliver Pajonk <ol...@gmail.com>.
2006/3/21, Craig White <cr...@azapple.com>:
>
>
> after the merge, I've got...
>
> $ ls app/controllers/application.rb*
> app/controllers/application.rb
> app/controllers/application.rb.merge-left.r14
> app/controllers/application.rb.working
> app/controllers/application.rb.merge- right.r20
>
> and I'm certain that I want the revision 20 version. What is the proper
> way to handle this?
>
>
The way is to edit "app/controllers/application.rb" so that it contains the
version that you want (merging left and right is the obvious way, but as you
definitely want r20, just copy it and overwrite
"app/controllers/application.rb"). Then mark the conflict as "resolved" with
something like:

svn resolved app/controllers/application.rb

That will get rid of the "weird" files and just leave
"app/controllers/application.rb" behind and remove the "conflict" status.
Then you can just commit it and you're done.
--
Oliver Pajonk

PS: Sorry Craig for the double-post, I hit the "Reply" button instead of
"Reply all"...

Re: merging a branch to the trunk

Posted by Craig White <cr...@azapple.com>.
On Tue, 2006-03-21 at 09:48 -0700, Craig White wrote:

> > You need to get the revision number at which you created the branch.  
> > As someone else already said, use "svn log --stop-on-copy" on the  
> > branch to discover that. Then merge from that revision to the most  
> > recent revision of the branch. So for example if you discover using  
> > "svn log --stop-on-copy" that you created the branch in revision 10,  
> > and now it's revision 20, then that means you want to take the list  
> > of changes performed between revisions 10 and 20 of the branch, and  
> > perform them on a working copy of the trunk. Therefore:
> > 
> > cd /home/craig/svn/th-db/trunk
> > svn merge -r10:20 \
> > svn+craigssh://craig@srv1.example.com/home/craig/svn/th-db/branches/ 
> > phase2
> ----
> excellent - I wouldn't have connected the 'svn log --stop-on-copy' to my
> trying to merge but indeed, that told me that I only needed to merge
> from revision 14 to 20, dry run log looks to be what I want and I'm
> throwing all remaining caution to the wind.
----
OK - now I am a little lost here and I'm wondering the best way to
handle this.

after the merge, I've got...

$ ls app/controllers/application.rb*
app/controllers/application.rb
app/controllers/application.rb.merge-left.r14
app/controllers/application.rb.working
app/controllers/application.rb.merge-right.r20

and I'm certain that I want the revision 20 version. What is the proper
way to handle this?

I have been using kdesvn for a visual look which runs Kompare for diffs
but they won't save and put some code in /tmp/kde-craig/... but that is
of no value to me.

How do I get it all merged down to the last revision and remove all the
cruft so I end up with just application.rb ?

Craig


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: merging a branch to the trunk

Posted by Craig White <cr...@azapple.com>.
On Tue, 2006-03-21 at 17:30 +0100, Ryan Schmidt wrote:
> On Mar 21, 2006, at 16:47, Craig White wrote:
> 
> > Let me try to describe what I am trying to do in another way.
> >
> > I want to merge my branch 'phase2' into my main trunk
> >
> > I change directories to my main trunk
> > $ pwd
> > /home/craig/svn/th-db/trunk
> >
> > svn merge --dry-run -r 1:20 svn \
> > +craigssh://craig@srv1.example.com/home/craig/svn/th-db/branches/ 
> > phase2
> >
> > but it 'appears' to me that it is creating everything new inside my
> > trunk...
> >
> > Skipped 'test'
> > Skipped 'test/unit'
> > A    test/unit/client_test.rb
> > A    test/unit/user_test.rb
> > A    test/unit/notifier_test.rb
> > A    test/unit/clients_test.rb
> > A    test/unit/error_mailer_test.rb
> > A    test/unit/facility_test.rb
> > A    test/unit/case_manager_test.rb
> > A    test/unit/referral_note_test.rb
> > A    test/unit/case_managers_test.rb
> > A    test/unit/placement_test.rb
> > A    test/test_helper.rb
> >
> > when all these files already exist in the 'trunk'
> 
> Subversion tracks back through time. When you ask for revision 1 of  
> branches/phase2, Subversion sees that branches/phase2 didn't exist in  
> revision 1, but at some point after revision 1 you created that  
> branch by copying the trunk. So Subversion tracks back to the trunk  
> and gives you changes that occurred there, including the adding of  
> those files. That's why it's adding them now.
> 
> You need to get the revision number at which you created the branch.  
> As someone else already said, use "svn log --stop-on-copy" on the  
> branch to discover that. Then merge from that revision to the most  
> recent revision of the branch. So for example if you discover using  
> "svn log --stop-on-copy" that you created the branch in revision 10,  
> and now it's revision 20, then that means you want to take the list  
> of changes performed between revisions 10 and 20 of the branch, and  
> perform them on a working copy of the trunk. Therefore:
> 
> cd /home/craig/svn/th-db/trunk
> svn merge -r10:20 \
> svn+craigssh://craig@srv1.example.com/home/craig/svn/th-db/branches/ 
> phase2
----
excellent - I wouldn't have connected the 'svn log --stop-on-copy' to my
trying to merge but indeed, that told me that I only needed to merge
from revision 14 to 20, dry run log looks to be what I want and I'm
throwing all remaining caution to the wind.

Thanks

Craig


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: merging a branch to the trunk

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Mar 21, 2006, at 16:47, Craig White wrote:

> Let me try to describe what I am trying to do in another way.
>
> I want to merge my branch 'phase2' into my main trunk
>
> I change directories to my main trunk
> $ pwd
> /home/craig/svn/th-db/trunk
>
> svn merge --dry-run -r 1:20 svn \
> +craigssh://craig@srv1.example.com/home/craig/svn/th-db/branches/ 
> phase2
>
> but it 'appears' to me that it is creating everything new inside my
> trunk...
>
> Skipped 'test'
> Skipped 'test/unit'
> A    test/unit/client_test.rb
> A    test/unit/user_test.rb
> A    test/unit/notifier_test.rb
> A    test/unit/clients_test.rb
> A    test/unit/error_mailer_test.rb
> A    test/unit/facility_test.rb
> A    test/unit/case_manager_test.rb
> A    test/unit/referral_note_test.rb
> A    test/unit/case_managers_test.rb
> A    test/unit/placement_test.rb
> A    test/test_helper.rb
>
> when all these files already exist in the 'trunk'

Subversion tracks back through time. When you ask for revision 1 of  
branches/phase2, Subversion sees that branches/phase2 didn't exist in  
revision 1, but at some point after revision 1 you created that  
branch by copying the trunk. So Subversion tracks back to the trunk  
and gives you changes that occurred there, including the adding of  
those files. That's why it's adding them now.

You need to get the revision number at which you created the branch.  
As someone else already said, use "svn log --stop-on-copy" on the  
branch to discover that. Then merge from that revision to the most  
recent revision of the branch. So for example if you discover using  
"svn log --stop-on-copy" that you created the branch in revision 10,  
and now it's revision 20, then that means you want to take the list  
of changes performed between revisions 10 and 20 of the branch, and  
perform them on a working copy of the trunk. Therefore:

cd /home/craig/svn/th-db/trunk
svn merge -r10:20 \
svn+craigssh://craig@srv1.example.com/home/craig/svn/th-db/branches/ 
phase2



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org