vspacer
 
vspacer
 
Valid XHTML 1.0!
 
Valid CSS 1.0

How to Get and Checkout by Version Number or Label.

 

ZDS SourceSafe Information
ByDave Goodall

SourceSafe documentation is silent on how to get or checkout by label.
What you need to know...

Labelling a set of files in order to be able to uniquely identify the set of source files that went into a release at a given instant in time is a common and very effective method of managing releases.

You can use either Visual SourceSafe Explorer or the command line 'Label' command to apply labels to projects or files.

In the example below, we've checked in version 3 of file 'date.java' and labelled this file individually as 'Release 1.0'. After checking in version 6 we labelled the file as 'Release2.0.

After checking in version 7 we did something slightly different. We labelled Project 'Test' recursively as 'Release 2.1'. This label was inherited by file date.java, one of the files in project Test.


Sourcesafe History Dialog


Getting or checking out by Version number

Using numeric version numbers to access Sourcesafe files or projects is very straighforward:


By Version Number Visual SourceSafe Explorer Command Line

Get Latest Version Highlight a file in Visual SourceSafe Explorer. Right Click. On the pop-up menu click on 'Get Latest Version'. ss get "$/Test/date.java"

Get a previous version Highlight a file in Visual Sourcesafe Explorer. Right Click. On the pop-up menu click on 'History'. On the file's History dialog. highlight the version you want and click on the 'Get' button to extract it to the working folder. ss get "$/Test/date.java" -V6

Checkout latest version Highlight a file in Visual Sourcesafe Explorer. Right Click. On the pop-up menu click on 'Checkout' ss checkout "$/Test/date.java"

Checkout a previous version Not possible. Not possible.


Getting or checking out by Label.

The SourceSafe documentation is silent on how to get or checkout by label, but in fact SourceSafe can and will 'Get' and 'Checkout' by label.

What you need to know here is that:

- A 'version' can be either numeric or a text label.
- Label(s) displayed immediately above a numeric version in Sourcesafe explorer are usually inherited from a project. They can also appear if more than one label is individually applied to a file.
- Files with only one label, individually applied, are marked with a postbox icon.

So in Visual SourceSafe Explorer, highlighting the 'Revision 2.1' item line and clicking on the 'Get' button will extract the same revision of the file as if you had highlighted version 7.

Similarly, the command lines:

ss get "$/Test/date.java" -V"Release 2.1"

ss get "$/Test/date.java" -V7

are exactly equivalent, and will extract the same revision of the file.

Single labels applied individually to a file work just the same way:

Highlighting the 'Revision 2.0' item line and clicking on the 'Get' button will extract version 6.


   


Back to top | ZDS Home | This article updated December 20 2000.