You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Aaron Bennett <ab...@clarku.edu> on 2007/08/27 13:59:31 UTC

howto 'retrofit' a vendor branch?

Hello,

I think this is a newbie question, but I can't figure out how to 
accomplish this.  Here's my problem...

We've got a fairly hacked version of an open source package that we rely 
on.  ( maia mailguard, as a point of interest ).  The problem is, now 
that we've got it customized, the vendor has released at least two 
smallish-but-significant dot releases.  We're running a customized 1.0.0 
and current rev is 1.0.2.  When I first hacked it, I just hacked each 
file as needed until it did what I wanted, as if I'd never heard of 
'source control' or 'change management' before in my life. (!)

Now, however, I want to bring my changed version of 1.0.0 up to 1.0.2.  
I'm not _entirely_ sure of what files I hacked in 1.0.0 -- it's not a 
ton of them, but both the interface and the underlying stuff was 
modified quite a bit to fit into our environment and to satisfy the 
demands of our user support team.

Sounds like a job for... SUBVERSION, right?  RIGHT.  Especially since 
the maia guys use svn to maintain the project.

So I got svn installed and working and read the 'Version Control with 
Subversion' book on red-bean.com.  Awesome book and many thanks to the 
authors, by the way.  It seems to me after reading that I ought to treat 
the official dist of maia as a vendor branch in my main project. 

here's what I've done...

1.  I created the suggested skeleton, maia/trunk , maia/branches, 
maia/tags, maia/vendor.
2.  from my source directory, svn import https://svn/maia/trunk
3.  grab maia 1.0.2 source, svn import https://svn/vendor/1.0.2
4.  check out trunk as working copy svn co https://svn/maia/trunk; cd trunk

ok, now here's where I get messed up -- time to merge, right?

4.  svn merge https://svn/maia/vendor/1.0.2 https://svn/maia/trunk

what I get is:
[abennett@wide trunk]$ svn merge https://svn/maia/vendor/1.0.2 
https://svn/maia/trunk
Skipped missing target: 'LICENSE'
Skipped missing target: 'maia-mysql.sql'
Skipped missing target: 'amavisd-maia'
Skipped missing target: 'maia-pgsql.sql'
Skipped missing target: 'amavisd.conf.dist'
Skipped missing target: 'README'
Skipped missing target: 'maia.conf.dist'
Skipped missing target: 'reference'

( I don't understand that, I want to MERGE those missing files into the 
trunk... why is it skipping them? )

then, instead of merging the vendor's changes on all of the files, it 
deletes all of the old files and replaces them with new ones.  why?

for example:

D    php/error.php
D    php/welcome.php
D    php/confirm.php
D    php/auth.php
D    php/adminhelp.php
D    php/xadminusers.php
D    php/mailtools.php
D    php/view.php
D    php
A    php
A    php/error.php
A    php/welcome.php
A    php/confirm.php
A    php/auth.php
A    php/adminhelp.php
A    php/xadminusers.php
A    php/mailtools.php
A    php/view.php


I'm obviously missing something.  I thought, maybe I'm going the wrong 
way, and I want instead svn merge https://svn/maia/trunk 
https://svn/maia/vendor/1.0.2 . but that doesn't work either... it 
correctly adds the new files, but still deletes all of the old stuff and 
re-adds it instead of merging.

help!  It's clear that I'm confused, that's all that's clear though.

Thanks for your time,

Aaron Bennett
Unix Administrator
Clark University ITS

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

Re: howto 'retrofit' a vendor branch?

Posted by John Peacock <ze...@gmail.com>.
On 8/28/07, Ryan Schmidt <ry...@macports.org> wrote:
>
> You want to read the chapter in the book ( http://svnbook.org ) on
> Vendor Branches.
>
> You will want to ignore the fact that they use Subversion. Instead,
> get exports or source tarballs of their 1.0.0 and 1.0.2 source code.
> Import 1.0.0 into $REPO/vendor/mailguard/current using svn import.
> Copy it to $REPO/vendor/mailguard/1.0.0 using svn cp. Now import
> 1.0.2 into $REPO/vendor/mailguard/current and copy it to $REPO/vendor/
> mailguard/1.0.2 using svn_load_dirs.pl.
>

Alternatively, since this is going to be an ongoing process, Aaron may want
to install SVK <http://svk.bestpractical.com/view/HomePage> - which has
superior merge tracking (at least until 1.5.0 0) and a smarter import - and
mirror the remote project's entire repository, e.g.:

$ svk depot PROJECT /path/to/depot/PROJECT
$ svk mirror http://remote.server.tld/project /PROJECT/mirror
$ svk sync /PROJECT/mirror

Establish a local branch for custom development

$ svk cp /PROJECT/mirror/trunk@1234 /PROJECT/local/trunk

where 1234 was the change number where you are nominally branching from
(which you can probably find from the tag for 1.0.0).  You want to copy your
local branch from the project's trunk, since that makes the inheritance
clearer.

Now import the local changes into the local branch:

$ svk import path/to/local/version /PROJECT/local/trunk

This will automatically handle all of the adds/deletes/renames that you did
on the project locally.  Finally, check out the local branch:

$ svk co /PROJECT/local/trunk project/trunk

and test the import to make sure it is exactly the same as your local
version (it should be file by file identical).

Finally, update the working copy to the latest mirrored code:

$ cd project/trunk
$ svk up -sm

That "-sm" both syncs the remote mirror and automatically merges in the
changes to the working copy.  This is the real strength of SVK; going
forward, you only need to run 'svk up -sm' whenever you want to pick up the
upstream changes, and you are completely free to continue making changes to
your local branch.

HTH

John

Re: howto 'retrofit' a vendor branch?

Posted by Mark Reibert <sv...@reibert.com>.
On Tue, 2007-08-28 at 02:08 -0500, Ryan Schmidt wrote:
> You want to read the chapter in the book ( http://svnbook.org ) on  
> Vendor Branches.

In particular, read the section describing the svn_load_dirs.pl script,
which handles many of the mundane tasks surrounding importing vendor
drops. One nice feature, for example, is svn_load_dirs.pl allows you to
handle renames on the vendor drops.

-- 
----------------------
Mark S. Reibert, Ph.D.
svn@reibert.com
----------------------

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

Re: howto 'retrofit' a vendor branch?

Posted by Mark Reibert <ma...@reibert.com>.
On Tue, 2007-08-28 at 02:08 -0500, Ryan Schmidt wrote:
> You want to read the chapter in the book ( http://svnbook.org ) on  
> Vendor Branches.

In particular, read the section describing the svn_load_dirs.pl script,
which handles many of the mundane tasks surrounding importing vendor
drops. One nice feature, for example, is svn_load_dirs.pl allows you to
handle renames on the vendor drops.

-- 
----------------------
Mark S. Reibert, Ph.D.
mark@reibert.com
----------------------

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

Re: howto 'retrofit' a vendor branch?

Posted by Aaron Bennett <ab...@clarku.edu>.
Thanks, that pointed me in the right direction.

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

Re: howto 'retrofit' a vendor branch?

Posted by Ryan Schmidt <ry...@macports.org>.
On Aug 27, 2007, at 08:59, Aaron Bennett wrote:

> We've got a fairly hacked version of an open source package that we  
> rely on.  ( maia mailguard, as a point of interest ).  The problem  
> is, now that we've got it customized, the vendor has released at  
> least two smallish-but-significant dot releases.  We're running a  
> customized 1.0.0 and current rev is 1.0.2.  When I first hacked it,  
> I just hacked each file as needed until it did what I wanted, as if  
> I'd never heard of 'source control' or 'change management' before  
> in my life. (!)
>
> Now, however, I want to bring my changed version of 1.0.0 up to  
> 1.0.2.  I'm not _entirely_ sure of what files I hacked in 1.0.0 --  
> it's not a ton of them, but both the interface and the underlying  
> stuff was modified quite a bit to fit into our environment and to  
> satisfy the demands of our user support team.
>
> Sounds like a job for... SUBVERSION, right?  RIGHT.  Especially  
> since the maia guys use svn to maintain the project.
>
> So I got svn installed and working and read the 'Version Control  
> with Subversion' book on red-bean.com.  Awesome book and many  
> thanks to the authors, by the way.  It seems to me after reading  
> that I ought to treat the official dist of maia as a vendor branch  
> in my main project.
> here's what I've done...
>
> 1.  I created the suggested skeleton, maia/trunk , maia/branches,  
> maia/tags, maia/vendor.
> 2.  from my source directory, svn import https://svn/maia/trunk
> 3.  grab maia 1.0.2 source, svn import https://svn/vendor/1.0.2
> 4.  check out trunk as working copy svn co https://svn/maia/trunk;  
> cd trunk
>
> ok, now here's where I get messed up -- time to merge, right?
>
> 4.  svn merge https://svn/maia/vendor/1.0.2 https://svn/maia/trunk
>
> what I get is:
> [abennett@wide trunk]$ svn merge https://svn/maia/vendor/1.0.2  
> https://svn/maia/trunk
> Skipped missing target: 'LICENSE'
> Skipped missing target: 'maia-mysql.sql'
> Skipped missing target: 'amavisd-maia'
> Skipped missing target: 'maia-pgsql.sql'
> Skipped missing target: 'amavisd.conf.dist'
> Skipped missing target: 'README'
> Skipped missing target: 'maia.conf.dist'
> Skipped missing target: 'reference'
>
> ( I don't understand that, I want to MERGE those missing files into  
> the trunk... why is it skipping them? )
>
> then, instead of merging the vendor's changes on all of the files,  
> it deletes all of the old files and replaces them with new ones.  why?
>
> for example:
>
> D    php/error.php
> D    php/welcome.php
> D    php/confirm.php
> D    php/auth.php
> D    php/adminhelp.php
> D    php/xadminusers.php
> D    php/mailtools.php
> D    php/view.php
> D    php
> A    php
> A    php/error.php
> A    php/welcome.php
> A    php/confirm.php
> A    php/auth.php
> A    php/adminhelp.php
> A    php/xadminusers.php
> A    php/mailtools.php
> A    php/view.php
>
>
> I'm obviously missing something.  I thought, maybe I'm going the  
> wrong way, and I want instead svn merge https://svn/maia/trunk  
> https://svn/maia/vendor/1.0.2 . but that doesn't work either... it  
> correctly adds the new files, but still deletes all of the old  
> stuff and re-adds it instead of merging.
>
> help!  It's clear that I'm confused, that's all that's clear though.

You want to read the chapter in the book ( http://svnbook.org ) on  
Vendor Branches.

You will want to ignore the fact that they use Subversion. Instead,  
get exports or source tarballs of their 1.0.0 and 1.0.2 source code.  
Import 1.0.0 into $REPO/vendor/mailguard/current using svn import.  
Copy it to $REPO/vendor/mailguard/1.0.0 using svn cp. Now import  
1.0.2 into $REPO/vendor/mailguard/current and copy it to $REPO/vendor/ 
mailguard/1.0.2 using svn_load_dirs.pl.

Now you can go into a working copy of your modified 1.0.0 code, and  
ask Subversion to upgrade it to 1.0.2:

cd wc-of-your-code
svn merge $REPO/vendor/mailguard/1.0.0 $REPO/vendor/mailguard/1.0.2

Resolve conflicts, test, commit.


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