I have been experimenting with SVN for a while. I have a little test project in order to test different aspect of being an SVN administrator and an SVN user. Here is a bit of introduction first.
I have a script:
<repos>/python/testScript/trunk/testScript.py
this script checks an environment variable $LOCALSITE and lists the result. Today I have found a bug which simply breaks the script if that env. variable is not set. So I immediately branched to:
<repos>/python/testScript/branches/branch-00.01.xx/testScript.py
and also pushed a tag:
<repos>/python/testScript/tags/0.1.1/testScript.py
So this first tag is still inheriting the bug of “Failure in case $LOCALSITE is not set.” just as the trunk is still suffering from the same problem.
The reason that I have pushed a tag is that I am %100 sure that this script will be executed in an environment that will have the $LOCALSITE set-up correctly. So it will not break. And people can keep using “tag-0.1.1” as usual.
However I still want to fix that problem. So here is the question:
I have fixed and tested the problem on “branch-00.01.xx/testScript.py”, so now I know that “branch-00.01.xx” is working, unless there are more hidden bugs. Was that the correct step? or should I have fixed the trunk?
Now what should I do? Should I push the fixed branch to a new tag? or should I fix the trunk and kill the branch “branch-00.01.xx”?
Thanks.
The branch model assumes that when you are done working on a feature, you will merge it back into the trunk. There’s no need to tag it, since you don’t want to expose it to the outside world. (In reality you could have done this fix directly on the trunk, but I understand that you’re exploring the process).
Since you’re just getting started, I suggest you take a look at mercurial: Its syntax is pretty svn-like, but it’s the next generation of “distributed” version control. I don’t mean to trash-talk svn, it’s a great system, but this is something you’ll want to know about too.