But the labels in VSS actually allow one to easily mark everything so that
you can come back years later and recover it exactly. I'm not pushing VSS,
actually I like Subversion and Tortoise better than VSS, I just happen to
use both.
Once the externals are setup, the project can always be reverted to the
right state for a given revision.
Try the following experiment (or just read along and trust that it really
turns out the way that I say it does...the ending has quite the twist for
those who think that Subversion tags actually do anything useful from an
archival standpoint)
1. Setup a new repository
2. Add new folders called 'Project1' and 'Project2' to the repo.
3. Export 'Project1' to some folder
4. Add the svn_external property to the working copy of 'Project1' to
reference 'Project2'.
5. Do an update to get Project2 into the working copy.
6. Create a new text file called 'Project2_File.txt' in the Project2 folder.
7. Edit Project2_File.txt so it has the single line of text 'This is line
#1'
8. Add Project2_File.txt into 'Project2' and commit the changes to both
'Project1' and 'Project2'.
At this point, what you've emulated is the creation of a new design called
'Project1' that refers to some presumably reusable module called 'Project2'.
Consider for the moment that reusable modules always begin life somewhere
and many times this begining is during the development of some bigger thing.
So in this case 'Project1' is the *bigger* thing, and 'Project2' is the
newly created (but intended to be reusable) module.
In this scenario both projects are likely both being developed concurrently
and, for the most part, up until towards the end of the development cycle
'Project1' will most likely always want to be referring to the
latest/greatest (i.e. the 'head' revision in Subversion-speak). For that
scenario then, one would most likely want to leave the revision off of the
'svn_external' reference thereby defaulting to the 'head'. You might not
want to, but indulge me. Anyway, so far, so good.
9. Create your tag of 'Project1' using 'svn copy' or TortoiseSVN so that you
get the warm fuzzy feeling that you've successfully archived away the
current state of 'Project1' at this moment in time confident that you can
come back at any time to recover this entire project exactly as it was left
after step #8. To do so you will of course be specifying the exact revision
of 'Project1' to use to create the tag. Lets say this tagged version of
'Project1' is put into the archive at 'Tags/Project1_1.0'
Step 9 emulates what one would be doing when you've completed development
and are getting ready to release. The purpose of the tag
'Tags/Project1_1.0' is to permanently archive away the 'Project1' design and
any of its subprojects for posterity so that they can be recreated at any
point in the future regardless of any future changes to either 'Project1' or
'Project2'.
10. Checkout 'Tags/Project1_1.0' to a folder 'Project1_1.0_Step10'
11. Open up the file ''Project1_1.0_Step10\Project2\Project2_File.txt' and
it will of course have one line of text "This is line #1"...again all is
well and good
12. Go back to the original working copy where you created 'Project1', or
better yet delete all of the folders so there are no working copies. Then
check out 'Project1' (not the archived tag, but the original) to create a
working copy in 'Project1-NEW'
13. Edit the file 'Project1-NEW\Project2\Project2_File.txt' by adding a new
line "This is line #2" and commit it to the repository.
Steps 12 and 13 emulate entering design changes into the 'trunk', perhaps to
add new functionality, bug fixes, documenation, whatever. You've dutifully
avoided changing the 'tag' branch, you've made modifications only to the
trunk as per all the Subversion recommended procedures (actually I've
skipped over the creating of a branch and the merge back into the trunk just
for simplicity).
14. Now let's checkout 'Tags/Project1_1.0' again, this time to the folder
'Project1_1.0_Step_14'
Step 14 is emulating the attempted recovery of the tag of 'Project1' as it
was archived back on step 9. This would be a normal support activity, the
re-creation of all of the source files as they existed at some previous time
to investigate some odd customer reported activity.
15. Open the file 'Project1_1.0_Step_14\Project2\Project2_File.txt'
16. Pick your jaw up, wipe the sweat off your brow, or do whatever it is
that you think is appropriate when you see that this file (checked out from
the safely and dutifully archived 'tag' remember) now has two lines of text
This is line #1
This is line #2
17. Explain to me how you think you've archived the actual source files and
can re-create any of your released builds because you've 'tagged' them.
---
Now this story could have had a happier ending. You could vehemently object
and say that in step #4 when the 'svn_external' was first added that by
golly you would never have let this go, you would always have specified a
particular revision. Fair enough, and if 'Project2' is always some locked
down, well debugged, never ever going to change thing and that's the only
type of thing you would ever reference via 'svn_external' you might have a
point. But remember the scenario I was painting, both 'Project1' and
'Project2' were being developed simultaneously, both subject to change.
I'll boldly make the following claims about such an approach
- Very, very little is ever likely to meet the standard of "locked down,
well debugged, never ever going to change"
- You're creating a lot more needless work for yourself by manually
specifying revisions for every 'svn_external'...and when you think about it,
this extra work is because the version control system you're using has
trouble recreating a specific revision.
- You haven't considered that others might not be quite as diligent as you
about always manually adding revisions, so then what?
A few questions come to mind: How much effort do you think is worth
expending to cover the omissions of others? Ask yourself why a highly
regarded version control system should have such a glaring deficiency in
actually being able to recover archived versions properly? Don't work
yourself into a dither though, help may be on the way.
The method to recover from all the bad things that you realized in step #16
might be are (but beware the bogey on step 22):
18. Google for svncopy.pl. Download it, it's a PERL script
19. Google for and download and install some version of PERL if necessary.
20. Go to your repository log and figure out which revision of your
repository created the tag that you did in Step #9. I'm sure you added a
log message entry during your commit to facilitate this
21. Type in the following (replacing xxxx with the revision you determined
in #20, and of course replacing the repo links as appropriate for the source
and destination of the copy
perl svncopy.pl --tag --revision xxxx file:///C:/Mysvn/Project1
file:///C:/Mysvn/Tags/Project1_1.0-Svncopy
22. Hope that you don't get the error message:
Can't call method "temp_dir" on an undefined value at \program
files\subversion\svncopy.pl line 221.
23. If you're lucky with step #22, you should now have a correctly tagged
'Project1' that has really archived the entire revision. Repeat steps 12
and 13 and see if it really sticks. If so, then exhale.
If you're not so lucky on step #22 and get the error message, please post
the solution to this problem. Even Google failed to come up with the
solution although it appears many have run across this problem. If you're
stuck having this problem, exhale anyway, holding your breath doesn't really
help.
Kevin Jennings
P.S. I am looking for the solution to the error message in a Windows
environment if anyone can provide it.
P.P.S. Obviously this post has more to do with Subversion then VHDL so I
apologize but there do seem to be some misconceptions among this group about
just how useful a 'tag' really is from an archival perspective when using
'svn_external' to reference reusable widgets.