help with subversion merging

asdf fia_wrc_fanatic-/E1597aS9LQAvxtiuMwx3w at public.gmane.org
Tue May 22 23:29:45 UTC 2007


--- Neil Watson <tlug-neil-8agRmHhQ+n2CxnSzwYWP7Q at public.gmane.org> wrote:

> I'm having a problem understanding svn merges.  Consider this repository
> layout
> 
> myrepo/branches/development/
> myrepo/trunk/
> 
> I want to merge the development branch at revision 117 to the head of
> trunk. I tried this:
> 
> svn co svn+ssh://svn/home/svn/myrepo
> cd myrepo/trunk
> svn merge --dry-run svn+ssh://svn/home/svn/myrepo/branches/development@117
> svn+ssh://svn/home/svn/myrepo/trunk@HEAD        
> 
> A collection of 'Skipped missing target' messages are returned.
> 
> What have I missed?
> 

I find branch merges quite confusing so what I normally do is:

(1) first identify what revisions I want to merge to the destination. These can
include single revisions or ranges of revisions
(2) merge each revision or range of revisions one by one to the destination. This
makes it easier for me to understand what I am doing!

With your specific case above, here's what I would do assuming that you want to
merge the changes in branches/development that resulted in revision 117 to trunk:

(1) Make sure that your trunk WC (working copy) is at the HEAD rev:
   cd myrepo/trunk
   svn up

(2) Do the merge:
   svn merge -r 116:117 myrepo/branches/development/ .

(3) If the merge was successful and merged in the changes that you wanted, check it
in:
   svn ci -m "Merge from branches/development at r117 to trunk"

(I left out your repository URLs to keep the text above short). In case step (2) did
not complete successfully you could always "svn revert" your trunk WC to undo any
unwanted merges or you could just use the --dry-run option to preview the merge
operation.

Also, your merging success depends on the common ancestry between
branches/development and trunk i.e. there must be some common
files/folders/projects/etc. at the root level of both branches/development/ and
trunk/ for the merge to succeed. Otherwise I think you'll see the 'Skipped missing
target' messages that you saw first.

Another point worth mentioning is that you were attempting to merge directly from a
repository URL to another repository URL directly i.e. without doing the merge on a
WC first. I don't know if that is even supposed to work as I have always understood
merging to be done on a WC first so that the merge can first be tested and then
committed back to the repository once satisfactory.

Here is a post from the svn-users mailing list that I've saved that explains branch
merging very well:

http://svn.haxx.se/users/archive-2006-08/0675.shtml

I just checked the Subversion book and it does indeed confirm that a merge operation
_has to_ be applied to a local WC and cannot be applied directly to a repository
location:

http://svnbook.red-bean.com/nightly/en/svn-book.html#svn.branchmerge.copychanges.keyconcept

Hope this helps somewhat. Let me know how you make out.
Cheers,


Salman Ahmed


       
____________________________________________________________________________________Get the Yahoo! toolbar and be alerted to new email wherever you're surfing.
http://new.toolbar.yahoo.com/toolbar/features/mail/index.php
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list