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

Re: Derive a new release/project from a current project/trunk

From: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: Sun, 3 Feb 2008 13:57:52 -0600

On Feb 3, 2008, at 13:46, Yavuz B. wrote:

> i want to derive a new release from my actual trunk. Actually i tag
> a release, so i can always check this tag out for older clients.
> But when i want to bugfix something in an older release an want
> that these changes apply to the old ones and the the actual
> release, how can realze this with subversion? i knew this feature
> from microsoft sourcesafe. there it is possible, to fix an old
> revision an the changes are apllied to the actual trunk/relase. I
> dont know how this is called. can someone help?

I assume where you use the words "actual"/"actually" you mean to use
the words "current"/"currently".

You cannot change revisions. They are immutable. Well, except for
revision properties. You can change revision properties if you
install a pre-revprop-change hook script to allow such a change. But
you're asking about revision contents, not properties.

Tags in Subversion are also supposed to be immutable. Nothing in
Subversion prevents you from changing a tag, but you're not supposed
to. Everyone using Subversion understands a tag to be a snapshot in
time which should never be changed.

If you want to be able to both develop a newer version (in trunk) and
fix bugs on an older version, what you want is a branch for the older
version. You can fix your bug in the older version's branch, then
make a new tag of that.

Example:

/repo/
        project/
                trunk/
                branches/
                tags/

You've developed your software in trunk and are now ready to call it
version 1.0. You make a branch and a tag:

svn cp $REPO/project/trunk $REPO/project/branches/1.x
svn cp $REPO/project/branches/1.x $REPO/project/tags/1.0

/repo/
        project/
                trunk/
                branches/
                        1.x/
                tags/
                        1.0/

Now you continue to develop in trunk, adding new features, and this
will eventually become version 2.0. But while you're doing this, you
find a bug in 1.0 and need to fix it quick. So you check out branches/
1.x, make the change, test it, and commit it. Then you tag that as 1.1:

svn cp $REPO/project/branches/1.x $REPO/project/tags/1.1

/repo/
        project/
                trunk/
                branches/
                        1.x/
                tags/
                        1.0/
                        1.1/

If the bug also exists in trunk, then you need to port your bugfix to
trunk. "svn merge" can help you there.

cd trunk-wc
svn merge -c$R $REPO/project/branches/1.x .

where $R is the revision in which you fixed the bug on the 1.x
branch. Now you test the fix in trunk and then commit it. Now the bug
is fixed in trunk too.

---------------------------------------------------------------------
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-03 20:58:22 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.