[GLLUG] Once more about Subversion

Nithin Philips philipsn at msu.edu
Tue Feb 5 19:12:47 EST 2008


frank.dolinar at comcast.net wrote:
> To all, again, thanks for the feedback.  It has helped and I've made some headway.  
> That being said, I have some more questions.
>
> 1.  Given that the documentation indicates that revisions update the "revision number" for the entire trees...
> and the documentation actually says:
>
> Global Revision Numbers
> Unlike most version control systems, Subversion's revision numbers apply to entire trees,
> not individual files. Each revision number selects an entire tree, a particular state of the
> repository after some committed change. Another way to think about it is that revision N
> represents the state of the repository filesystem after the Nth commit. When Subversion
> users talk about “revision 5 of foo.c”, they really mean “foo.c as it appears in revision
> 5.” Notice that in general, revisions N and M of a file do not necessarily differ! Many other
> version control systems use per-file revision numbers, so this concept may seem unusual
> at first. (Former CVS users might want to see Appendix B, Subversion for CVS Users for
> more details.)
>
> Are we talking about folders with sub structure or are we talking about the entire repository.
>   
Revisions apply to the entire repository. Any change anywhere will 
increment the revision of the repository (although most of the files 
will be unchanged).
>
> 2.  I think I understand what a branch is at this point.  Under what circumstances would I want to create one?
>   
Branches are usually made to do development that would otherwise 
interfere with the trunk. Say you want to add a new feature that may 
cause instability to the program, but you want to maintain a stable 
version for your users as well. You can create a branch where you would 
add the feature, test it, and when done, merge that branch back into the 
trunk. (This is just one usage scenario, there are many possible ways to 
take advantage of branches.)

Chapter 4 <http://svnbook.red-bean.com/en/1.1/ch04.html> of the SVN Red 
book has more info.
> 3.  Related to question # 2, similar question about tags.
>   
Tags are snapshots of the trunk (or any other folder.) You usually make 
a tag when you make a release or reach a significant milestone.
> 4.  The "MyProject" folder contains a .svn folder, a trunk folder, a branches folder, and a tags folder.   I'm placing my code files in the "MyProject" folder... except when I create a branch?  How do I make sure the code for the branch gets in the right location.  And related to question # 3, when and why do I associate a tag?
>   
The recommended usage is that you put your code files in the trunk, make 
tags and branches from the trunk. You wouldn't want to checkout the root 
folder because then you would have a local copy of EVERY file in the 
repository including all tags and branches.

Assuming you have this tree strucure:

./branches/
      branch1/
	foo.c
        bar.c
        …
      branch2/
	foo.c
        bar.c
        …
./tags/
      tag1/
	foo.c
        bar.c
        …
./trunk/
       foo.c
       bar.c
       …

If you checkout the root folder you would have all the files listed 
above. Usually you checkout just the trunk folder (or a branch, if you 
are working on it).
To create a branch or a tag you use the copy command

svn copy trunk branches/branch1

OR

svn copy trunk tag/tag1

> Yeah, I know I'm being a little dense about this.  But I want to get it right.
>
> thanks again for all the help.
>
> Frank
Again, Chapter 4 of the SVN Red Book explains this in much detail. Hope 
this helps.


More information about the linux-user mailing list