Production tags

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
rakkar3
Posts: 50
Joined: Sat May 06, 2006 2:05 pm

Production tags

Post by rakkar3 » Tue May 16, 2006 12:09 pm

Sorry in advance if this is a newbie question. I'm not sure what the difference is between snapshots, labels, tags, and branches. Anyway what I want to do is release (say) version 1.0 of my software with all the files currently in the repository going towards version 1.0. Then later I want to do version 1.1 the same way. And if I want to see what I had in version 1.0 (in case someone has a bug in that version) I want to be able to download or look at that version, without losing my 1.1 version, or my work in progress after 1.1.

How would I do this?

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Post by lbauer » Tue May 16, 2006 12:22 pm

Labels (same as tags) are a way to mark a file or folder at a particular point in time. So if you have finalized your code for Version 1.0, you could label the appropriate folder with the label "Version 1.0." You can view the label, get the label, etc., from the Show Labels command.

After labeling, you could also branch from the 1.0 label if bugs needed to be fixed, then merge the changes back into the trunk, which is your 1.1 development. A branch is a copy of a folder or file.

See a good discussion of branches here:

http://www.ericsink.com/scm/scm_branches.html

Snapshot info from Vault Client Help:

A Snapshot is similar to a branch, except that it automatically pins the folder that gets created. Before version 2.0, snapshots were called labels. Version 2.0 of Vault implemented Labels as tags on a folder rather than separate entries in the tree. Snapshots are equivalent to Version 1.0 labels.

· Snapshots vary from branches in the following ways:

· Snapshots are only available on folders

· A snapshot folder is clear rather than blue.

· Snapshots are automatically pinned after they are created.

· You can hide snapshot folders from your tree unchecking the “Show snapshots in folder tree” option in Tools->Options.

· If you do a recursive Get Latest operation above a snapshot, it will not retrieve the snapshot. Snapshots are only retrieved if you do the Get on the snapshot itself.

· If a folder is shared, doing a snapshot on the shared folder will create a snapshot, not break the share. (If you were to branch a shared folder, it would break the share. This is not the case for a snapshot).

It is recommended that you use branches or labels to mark a version of a tree. Snapshots are simply a historical oddity.
Linda Bauer
SourceGear
Technical Support Manager

rakkar3
Posts: 50
Joined: Sat May 06, 2006 2:05 pm

Post by rakkar3 » Tue May 16, 2006 12:34 pm

Thanks for the quick response!

Suppose I label the root directory as 1.0. While working on 1.1 I add some files to the root directory. If a user were to get 1.0, would they get these new files as well? (I wouldn't want them to get any files that didn't exist at the time of the label).

Also, can I branch, using the existing working directories on my harddrive? For example, suppose I had my project in c:\myproject. Now I want to work on a branch, don't need a separate local copy of the main branch, and want to merge any changes in the main branch to my working branch. So I still only want c:\myproject. I don't want to have to copy everything to c:\myproject2.

FYI the admin and I tried doing this with Perforce at work. He gave up after 2 days, and I gave up after 3, and just didn't bother branching. So if Vault supports it then kudos to you :)

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Wed May 17, 2006 1:50 pm

rakkar3 wrote: Suppose I label the root directory as 1.0. While working on 1.1 I add some files to the root directory. If a user were to get 1.0, would they get these new files as well? (I wouldn't want them to get any files that didn't exist at the time of the label).
If you do a Get by Label on 1.0, it will not retrieve files that were added later. It would get the tree exactly as it existed at the version you labeled 1.0.

Note however that you can't easily make modifications to files in the 1.0 label if you later wanted to change 1.0. That's the difference between label and branch - branch allows you to continue modifying the tree, whereas label is more of a marking a point in time and allowing you to get those files as they existed then.
Also, can I branch, using the existing working directories on my harddrive? For example, suppose I had my project in c:\myproject. Now I want to work on a branch, don't need a separate local copy of the main branch, and want to merge any changes in the main branch to my working branch. So I still only want c:\myproject. I don't want to have to copy everything to c:\myproject2.
Branch is a Vault server operation, not a client operation. You definitely don't want two Vault folders to point to the same local folder as their working folder, because the state of the working folder will then become inconsistent.

You could decide to use c:\myproject for the branch instead of the trunk, but you'd want to remove it as the working folder for the trunk, just to make sure it doesn't mess up the state. Also, you'd need to do a full Get Latest after you switch over the branch, because in doing so, all the files will have an Unknown status, since they were not retrieved from the branch, and a Get Latest will resolve the state for them.

In the end though, I'd recommend keeping them separate, and create a different working folder for the branch. It is the safest approach.

Post Reply