You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Brad <su...@likethesky.com> on 2006/01/13 21:29:25 UTC

"replace" a project

I've searched the archives, but as my question is somewhat general and
could be accomplished in multiple ways, I haven't come across a previous
thread that deals with this fairly simple question:

We have a project (containing multiple subdirectories and files therein)
called /trunk/project that someone on the team--unfortunately--exported
from, made some changes to, then imported back in as /trunk/project1. 
Turns out we like what they did and now just want to "slam over the top
of" /trunk/project with /trunk/project1 and make /trunk/project1 go away
(delete it), so that the new /trunk/project will be our codebase going
forward and we'll have all the previous history still there if we want
it.

Doesn't seem like merge is what we want, as we just want a direct
replacement of /trunk/project with /trunk/project1.  Also I don't think
we want to delete /trunk/project and rename /trunk/project1 to
/trunk/project is what we want either, as then we lose the history in
(the original) /trunk/project...

Any simple way to accomplish what we want?

TIA,
Brad

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

Re: "replace" a project

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jan 14, 2006, at 15:01, Lieven Govaerts wrote:

>> We have a project (containing multiple subdirectories and
>> files therein) called /trunk/project that someone on the
>> team--unfortunately--exported from, made some changes to,
>> then imported back in as /trunk/project1.
>> Turns out we like what they did and now just want to "slam
>> over the top of" /trunk/project with /trunk/project1 and make
>> /trunk/project1 go away (delete it), so that the new
>> /trunk/project will be our codebase going forward and we'll
>> have all the previous history still there if we want it.
>>
>> Doesn't seem like merge is what we want, as we just want a
>> direct replacement of /trunk/project with /trunk/project1.
>> Also I don't think we want to delete /trunk/project and
>> rename /trunk/project1 to /trunk/project is what we want
>> either, as then we lose the history in (the original)
>> /trunk/project...

> a merge can't work here, since the files in trunk/project1 are
> considered new and not related to those in trunk/project ( even if
> they have the same name ).

That's not a reason for a merge not to work. Merge just means "Take  
the difference between A and B, and apply it to C." Doesn't matter if  
A and B have the same ancestry or not.


> In your situation I would make sure that the changes on
> /trunk/project1 would be re-applied to your original /trunk/project
> as a changeset.

That's what I'd do too, and I'd use svn merge to do it. Discover (by  
asking the person who originally made the export, or, if they don't  
know, then by analyzing the project1 code and comparing it to known  
states of project) the revision of project's trunk upon which the  
project1 changes were based. Call this X. Now get a working copy of  
trunk as it is in the repository now. Now do this:

svn merge \
url://to/repository/trunk/project@X \
url://to/repository/trunk/project1@HEAD \
.

That should mean: "Take the changes that occurred between project at  
revision X and project1 as it is now, and apply these to the current  
working copy of project's trunk."

Then you test the working copy, make sure it's as you want, then you  
commit, stating you merged in in the project1 changes. Then you can  
delete project1 from the repository.

And educate your "someone" on the proper use of feature branches to  
avoid this mess in the future.


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

RE: "replace" a project

Posted by Lieven Govaerts <lg...@mobsol.be>.
Brad, 


a merge can't work here, since the files in trunk/project1 are 
considered new and not related to those in trunk/project ( even if
they have the same name ).

In your situation I would make sure that the changes on 
/trunk/project1 would be re-applied to your original /trunk/project 
as a changeset.

You can use the approach also used with vendor branches:
http://svnbook.red-bean.com/nightly/en/svn.advanced.vendorbr.html

In short, what you do is checkout your trunk/project and 
trunk/project1, copy the new & changed files from project1 over
the files of project and commit the changes.

In the Subversion repository, there is a script called svn_load_dirs.pl
that automates this operation. It also provides support to handle 
deleted and renamed files.

You can find the latest version of this script here:
http://svn.collab.net/viewcvs/svn/trunk/contrib/client-side/

Hope this helps.

Lieven.

> -----Original Message-----
> From: Brad [mailto:subversion.tigris.org@likethesky.com] 
> Sent: vrijdag 13 januari 2006 22:29
> To: users@subversion.tigris.org
> Subject: "replace" a project
> 
> I've searched the archives, but as my question is somewhat 
> general and could be accomplished in multiple ways, I haven't 
> come across a previous thread that deals with this fairly 
> simple question:
> 
> We have a project (containing multiple subdirectories and 
> files therein) called /trunk/project that someone on the 
> team--unfortunately--exported from, made some changes to, 
> then imported back in as /trunk/project1. 
> Turns out we like what they did and now just want to "slam 
> over the top of" /trunk/project with /trunk/project1 and make 
> /trunk/project1 go away (delete it), so that the new 
> /trunk/project will be our codebase going forward and we'll 
> have all the previous history still there if we want it.
> 
> Doesn't seem like merge is what we want, as we just want a 
> direct replacement of /trunk/project with /trunk/project1.  
> Also I don't think we want to delete /trunk/project and 
> rename /trunk/project1 to /trunk/project is what we want 
> either, as then we lose the history in (the original) 
> /trunk/project...
> 
> Any simple way to accomplish what we want?
> 
> TIA,
> Brad
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
> 
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.371 / Virus Database: 267.14.17/229 - Release 
> Date: 13/01/2006
>  
> 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.17/229 - Release Date: 13/01/2006
 


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