Discussion:
Tags and externals
s***@bt.com
2007-01-08 09:52:58 UTC
Permalink
Hi I am quite new to subversion and am trying out some things to get our
project cleaned up a bit.

If I have a repository structure like:

Prod_a
Prod_b
Common

Each of these directories contains a branch, tags and trunk sub-dir.

I use the propset svn:externals command to link common into Prod_a and
Prod_b and this works as I expected. Then I create a branch, and as
expected I have to update my external link to point to the correct
branch of common.

When I want to make a release, I create a tag (with is basically another
branch), however, when someone changes the common branch the tag is
updated with the new common code, so I have lost my release snapshot.
At first I was shocked, and then I realised this was clearly going to
happen.

So how am I supposed to create a TAG to snapshot my release in this
situation? I had not intended to put any tags in the common code at
all, as its never released outside of Prod_a or Prod_b. Do I have to
change my svn:external link somehow, or is there a better way of doing
what I want?

Thanks,

Stephen.
s***@bt.com
2007-01-08 13:18:36 UTC
Permalink
Hi,

I tried using the svncopy script, but it is giving some errors which I can't figure out:

[***@millhouse trunk]$ perl /home/sodonnel/svncopy.pl --branch file:///home/sodonnel/svn_branching/test_2/common/trunk file:///home/sodonnel/svn_branching/test_2/common/branch/bal_3

=================================================================
=== Copying from:
=== file:///home/sodonnel/svn_branching/test_2/common/trunk
===
=== Copying to:
=== file:///home/sodonnel/svn_branching/test_2/common/branch/bal_3
===
=== - branching (updating fully-contained svn:externals definitions)
===
Leaving /tmp/svncopy_uHoQWlFwbA for inspection
svncopy.pl: /home/sodonnel/svncopy.pl: 'svn log' failed : exit=0 signal=6

svncopy.pl: /home/sodonnel/svncopy.pl: 'svn mkdir' failed : exit=0 signal=6

svncopy.pl: Couldn't create directory 'file:///home/sodonnel'
svncopy.pl: Couldn't create parent directories for 'file:///home/sodonnel/svn_branching/test_2/common/branch/bal_3'

Can't call method "temp_dir" on an undefined value at /home/sodonnel/svncopy.pl line 221.


The branch destination definitely exists:

[***@millhouse trunk]$ svn ls file:///home/sodonnel/svn_branching/test_2/common/branch
bal_3/

As does the source:

[***@millhouse trunk]$ svn ls file:///home/sodonnel/svn_branching/test_2/common/trunk
***/
***/
...

(I masked out the directory names)

Any ideas?

Thanks,

Stephen.

-----Original Message-----
From: Felix Gilcher [mailto:***@exozet.com]
Sent: 08 January 2007 10:11
To: O'Donnell,S,Stephen,XMB R; ***@subversion.tigris.org
Subject: AW: Tags and externals

Hi,

if you want an external to point to a specific revision of the target, you can pass a "-r<revision>" in the externals definition. This is what you'd usually do in a tag. The svncopy.pl script (which should be in the contribs section of the subversion svn repository) will help you quite a bit when dealing with a large number of externals.

regards

felix
Post by s***@bt.com
Hi I am quite new to subversion and am trying out some things
to get our project cleaned up a bit.
Prod_a
Prod_b
Common
Each of these directories contains a branch, tags and trunk sub-dir.
I use the propset svn:externals command to link common into
Prod_a and Prod_b and this works as I expected. Then I
create a branch, and as expected I have to update my external
link to point to the correct branch of common.
When I want to make a release, I create a tag (with is
basically another branch), however, when someone changes the
common branch the tag is updated with the new common code, so
I have lost my release snapshot. At first I was shocked, and
then I realised this was clearly going to happen.
So how am I supposed to create a TAG to snapshot my release
in this situation? I had not intended to put any tags in the
common code at all, as its never released outside of Prod_a
or Prod_b. Do I have to change my svn:external link somehow,
or is there a better way of doing what I want?
Thanks,
Stephen.
--
Felix Gilcher
Head of IT Development

Exozet Berlin GmbH
Rotherstraße 20
10245 Berlin

eMail: ***@exozet.com
URL: www.exozet.com
Tim Hill
2007-01-09 04:37:05 UTC
Permalink
You don't really want externals in this case. All you really want to
do is to copy (branch) the common code into the release. In fact, you
probably want to do this anyway, even on the trunk, and not use
externals at all. Externals have the 'advantage" of auto update
propogation, but as you discovered, this really isnt the advantage
that is appears.

So, just copy from Common into an appropriate location in Prod_A and
Prod_B. Then use the merging features of Subversion to perform
updates from Common into the products as and when desired.

--Tim
Post by s***@bt.com
Hi I am quite new to subversion and am trying out some things to
get our project cleaned up a bit.
Prod_a
Prod_b
Common
Each of these directories contains a branch, tags and trunk sub-dir.
I use the propset svn:externals command to link common into Prod_a
and Prod_b and this works as I expected. Then I create a branch,
and as expected I have to update my external link to point to the
correct branch of common.
When I want to make a release, I create a tag (with is basically
another branch), however, when someone changes the common branch
the tag is updated with the new common code, so I have lost my
release snapshot. At first I was shocked, and then I realised this
was clearly going to happen.
So how am I supposed to create a TAG to snapshot my release in this
situation? I had not intended to put any tags in the common code
at all, as its never released outside of Prod_a or Prod_b. Do I
have to change my svn:external link somehow, or is there a better
way of doing what I want?
Thanks,
Stephen.
Bill Williams
2007-01-09 14:19:17 UTC
Permalink
While I have not used externals as of yet, you can define an explicit
revision number in the external definition; therefore, you will always
get the same thing from the external definition. Wouldn't this take
care of your problem where the comman branch is modified?
Post by s***@bt.com
Hi I am quite new to subversion and am trying out some things to get
our project cleaned up a bit.
Prod_a
Prod_b
Common
Each of these directories contains a branch, tags and trunk sub-dir.
I use the propset svn:externals command to link common into Prod_a and
Prod_b and this works as I expected. Then I create a branch, and as
expected I have to update my external link to point to the correct
branch of common.
When I want to make a release, I create a tag (with is basically
another branch), however, when someone changes the common branch the
tag is updated with the new common code, so I have lost my release
snapshot. At first I was shocked, and then I realised this was
clearly going to happen.
So how am I supposed to create a TAG to snapshot my release in this
situation? I had not intended to put any tags in the common code at
all, as its never released outside of Prod_a or Prod_b. Do I have to
change my svn:external link somehow, or is there a better way of doing
what I want?
Thanks,
Stephen.
s***@bt.com
2007-01-09 14:31:52 UTC
Permalink
Yea, that's pretty much what the svncopy.pl script seems to do. I think
it will resolve my problem quite nicely.



I posted an error yesterday with svncopy.pl doing something like:



perl /home/sodonnel/svncopy.pl --branch
file:///home/sodonnel/svn_branching/test_2/common/trunk
file:///home/sodonnel/svn_branching/test_2/common/branch/bal_3



It would seem that the problem is around using the file:// syntax - once
I started up svnserve and tried it using svn:// it worked just fine.



Cheers,



Stephen.



________________________________

From: Bill Williams [mailto:***@qcsoftware.com]
Sent: 09 January 2007 14:19
To: O'Donnell,S,Stephen,XMB R
Cc: ***@subversion.tigris.org
Subject: Re: Tags and externals



While I have not used externals as of yet, you can define an explicit
revision number in the external definition; therefore, you will always
get the same thing from the external definition. Wouldn't this take
care of your problem where the comman branch is modified?

***@bt.com wrote:



Hi I am quite new to subversion and am trying out some things to get our
project cleaned up a bit.

If I have a repository structure like:

Prod_a

Prod_b

Common

Each of these directories contains a branch, tags and trunk sub-dir.

I use the propset svn:externals command to link common into Prod_a and
Prod_b and this works as I expected. Then I create a branch, and as
expected I have to update my external link to point to the correct
branch of common.

When I want to make a release, I create a tag (with is basically another
branch), however, when someone changes the common branch the tag is
updated with the new common code, so I have lost my release snapshot.
At first I was shocked, and then I realised this was clearly going to
happen.

So how am I supposed to create a TAG to snapshot my release in this
situation? I had not intended to put any tags in the common code at
all, as its never released outside of Prod_a or Prod_b. Do I have to
change my svn:external link somehow, or is there a better way of doing
what I want?

Thanks,

Stephen.
Felix Gilcher
2007-01-08 10:10:30 UTC
Permalink
Hi,

if you want an external to point to a specific revision of the target, you can pass a "-r<revision>" in the externals definition. This is what you'd usually do in a tag. The svncopy.pl script (which should be in the contribs section of the subversion svn repository) will help you quite a bit when dealing with a large number of externals.

regards

felix
Post by s***@bt.com
Hi I am quite new to subversion and am trying out some things
to get our project cleaned up a bit.
Prod_a
Prod_b
Common
Each of these directories contains a branch, tags and trunk sub-dir.
I use the propset svn:externals command to link common into
Prod_a and Prod_b and this works as I expected. Then I
create a branch, and as expected I have to update my external
link to point to the correct branch of common.
When I want to make a release, I create a tag (with is
basically another branch), however, when someone changes the
common branch the tag is updated with the new common code, so
I have lost my release snapshot. At first I was shocked, and
then I realised this was clearly going to happen.
So how am I supposed to create a TAG to snapshot my release
in this situation? I had not intended to put any tags in the
common code at all, as its never released outside of Prod_a
or Prod_b. Do I have to change my svn:external link somehow,
or is there a better way of doing what I want?
Thanks,
Stephen.
--
Felix Gilcher
Head of IT Development

Exozet Berlin GmbH
Rotherstraße 20
10245 Berlin

eMail: ***@exozet.com
URL: www.exozet.com
Continue reading on narkive:
Loading...