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

Re: lost all my original modification with an svn merge...

From: Ulrich Eckhardt <eckhardt_at_satorlaser.com>
Date: Mon, 25 Feb 2008 15:44:44 +0100

On Sunday 24 February 2008, Anthony Ettinger wrote:
> I had a direct copy of my production site in ./project/htdocs
> I was trying to do a vendor branch merge, into ./project/htdocs, but
> when I did, I lost all my old files that I had added and/or
> customized.

What exactly does the 'vendor branch' mean in 'vendor branch merge'?

> this is the command I ran:
>
> svn merge ./vendor/wordpress/2.0.4 ./vendor/wordpress/current
> ./project/htdocs

As Ryan said, this should have worked. However, I can imagine why it didn't
work and that is when the difference that SVN computes between '2.0.4'
and 'current' is roughly this:
 1. delete '2.0.4'
 2. import 'current'
The simple reason is that SVN then simply does the same, which obviously leads
to complete deletion of your changes. Note that this also isn't how it should
have been done, SVN has a script which allows you to track external sources,
it's called svn_load_dirs and it should help you in the future.

> this resulting in deletion of files that were in ./project/htdocs
> originally, but not in ./vendor/wordpress/2.0.4 originally...
> not really what I wanted to do, is there any way to do the vendor
> branch upgrade w/o loosing customized data from the original source?

One question in between: ./project/htdocs is not just a working copy but also
versioned somewhere, right? If not, and SVN actually deleted local and
unversioned modifications (i.e. modifications that can't be recovered from a
repository) then it would be considered a bug.

However, I guess that at some time in the past you just
copied 'wordpress/2.0.4' to 'project/htdocs' and then started modifying it.
In that case, you could take the reverse route:
 1. svn co ../wordpress/current # create WC
 2. cd current
 3. svn merge -rX:Y ../project/htdocs . # merge changes

This simply calls the 'htdocs' dir a branch (made from wordpress 2.0.4) and
you are now merging the branch into the current wordpress version. Obviously,
you don't check this into wordpress/current (which remains an exact copy of
upstream) but rather a different and new location.

There is a similar method which performs this operation in the place of
project/htdocs. For that, from inside a working copy, do this:

 1. undo (reverse-merge) all changes since you branched from 2.0.4
 2. merge the diff between 2.0.4 and current
 3. redo (merge) all changes from step 1

You might have to make smaller steps in case any merge conflicts occur, in
particular in step 3. You can then also filter out unwanted changes, e.g. if
you locally fixed a bug that already received a different fix upstream.

cheers

Uli

-- 
ML: http://subversion.tigris.org/mailing-list-guidelines.html
FAQ: http://subversion.tigris.org/faq.html
Docs: http://svnbook.red-bean.com/
Sator Laser GmbH
Geschäftsführer: Michael Wöhrmann, Amtsgericht Hamburg HR B62 932
**************************************************************************************
           Visit our website at <http://www.satorlaser.de/>
**************************************************************************************
Diese E-Mail einschließlich sämtlicher Anhänge ist nur für den Adressaten bestimmt und kann vertrauliche Informationen enthalten. Bitte benachrichtigen Sie den Absender umgehend, falls Sie nicht der beabsichtigte Empfänger sein sollten. Die E-Mail ist in diesem Fall zu löschen und darf weder gelesen, weitergeleitet, veröffentlicht oder anderweitig benutzt werden.
E-Mails können durch Dritte gelesen werden und Viren sowie nichtautorisierte Änderungen enthalten. Sator Laser GmbH ist für diese Folgen nicht verantwortlich.
**************************************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-02-25 15:49:47 CET

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.