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

Re: A merge question similar to the diff question

From: Jim Lynch <jimlynch1_at_gmail.com>
Date: 2005-10-25 23:28:44 CEST

Hi, Ryan,

Thanks to you and the others that have answered my questions. I think I'm
finally getting the hang of it. I wasn't able to disassociate revision
numbers from branches/trunk,


On 10/22/05, Ryan Schmidt <subversion-2005@ryandesign.com> wrote:
> On Oct 22, 2005, at 23:20, Ryan Schmidt wrote:
> > It looks like what you wanted was to take differences between trunk
> > and log4 and apply them to the trunk. If that's so, then your merge
> > command was fine, except you needed to perform it in the trunk
> > working copy, not the log4 branch working copy:
> >
> > cd trunk
> > svn merge svn+ssh://localhost/home/jlynch/svnrep/trunk \
> > svn+ssh://localhost/home/jlynch/svnrep/branches/log4
> >
> >
> > You wrote above that you wanted to "merge a file back into the
> > trunk." Now, I know that in CVS, it's normal to think in terms of
> > files, but in Subversion, you need to think in terms of revisions.
> > You'll generally make a change to a file, or to several files, and
> > maybe add some files and delete some others, and you'll commit all
> > of this together as one revision. Then you can take those same
> > changes and apply them somewhere else by doing a merge. You often
> > don't want to merge all changes on a branch back to the trunk;
> > instead, it's common to want to merge only one particular bugfix.
> > To do this, you need to keep track of the revision number in which
> > the change was made (or, if you've forgotten, look it up in the log).
> >
> I suppose I should point out that the merge command I gave above
> follows from this assumption: that log4 is identical to trunk, except
> that log4 has some improvements. If, on the other hand, it were the
> case that log4 has some improvements, but trunk also has some
> different improvements, then the effect of executing my merge above
> would be to add log4's improvements to trunk, but also to *remove*
> the other improvements that were already on the trunk.
> So it's better to work with revision numbers. Say the log4 branch was
> created by making a copy of trunk in revision 74. Now we're at
> revision 293. trunk has had some further development, and log4 has
> had different changes. Now you want to bring log4's changes into trunk.
> cd trunk
> svn merge -r74:293 svn+ssh://localhost/home/jlynch/svnrep/branches/log4
> # this is where you would test the changes
> svn commit
> And if you now continue to make other improvements in log4, and you
> later want to bring those changes into the trunk as well, then you
> need to ensure that you only merge the parts that you haven't merged
> before. If it's now revision 325, then:
> cd trunk
> svn merge -r293:325 svn+ssh://localhost/home/jlynch/svnrep/branches/log4
> # test
> svn commit
Received on Tue Oct 25 23:34:57 2005

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.