You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Anthony Ettinger <an...@chovy.com> on 2008/02/24 10:23:28 UTC

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

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.


this is the command I ran:

svn merge ./vendor/wordpress/2.0.4 ./vendor/wordpress/current ./project/htdocs

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?



-- 
Anthony Ettinger
408-656-2473
http://anthony.ettinger.name

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

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

Posted by Ulrich Eckhardt <ec...@satorlaser.com>.
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@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


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

Posted by marc gonzalez-carnicer <ca...@gmail.com>.
i won't tell you how to solve your loss of work, which may be
unrecoverable. instead i will tell you how to avoid this in
the future.

there are several ways to prevent data loss resulting from
a complicated or impossible merge.

if you feel the upcoming update may cause lots of conflicts, do
an svn export beforehand. you may also create a branch and
svn switch there before the update, then commit to the new
branch and later on merge the branches.

if you feel there the upcoming updates may cause conflicts, use
a separate branch and work there. at least you'll always be able
to commit.



2008/2/24, Anthony Ettinger <an...@chovy.com>:
> 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.
>
>
>  this is the command I ran:
>
>  svn merge ./vendor/wordpress/2.0.4 ./vendor/wordpress/current ./project/htdocs

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

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

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Feb 24, 2008, at 04:23, 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.
>
>
> this is the command I ran:
>
> svn merge ./vendor/wordpress/2.0.4 ./vendor/wordpress/current ./ 
> project/htdocs
>
> 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,

That's not what should have happened.

> is there any way to do the vendor
> branch upgrade w/o loosing customized data from the original source?

The merge command you showed should have done what you wanted. It  
constructs a difference between vendor/wordpress/2.0.4 and vendor/ 
wordpress/current and applies that diff to projects/htdocs. Should work.


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