11
MSTE
Visual SourceSafeVisual SourceSafeVisual SourceSafeVisual SourceSafe
For more information, see: http://www.microsoft.com/ssafeFor more information, see: http://www.microsoft.com/ssafe
22
MSTE
AgendaAgenda IntroductionsIntroductions Visual SourceSafe BasicsVisual SourceSafe Basics Advanced Visual SourceSafeAdvanced Visual SourceSafe QuestionsQuestions
33
MSTE
AgendaAgenda IntroductionsIntroductions Visual SourceSafe BasicsVisual SourceSafe Basics Advanced Visual SourceSafeAdvanced Visual SourceSafe QuestionsQuestions
44
MSTE
Basic Purposes of Visual Basic Purposes of Visual SourceSafeSourceSafe
Version control systems in general...Version control systems in general... Support team development, by coordinating Support team development, by coordinating
multiple users through a checkout/checkin protocolmultiple users through a checkout/checkin protocol Track versions of filesTrack versions of files
SourceSafe’s competitive advantage...SourceSafe’s competitive advantage... Track versions of entire projectsTrack versions of entire projects Track modular code: one file that is reused, or Track modular code: one file that is reused, or
shared, by multiple projectsshared, by multiple projects
55
MSTE
Visual SourceSafe BasicsVisual SourceSafe Basics Key SourceSafe ConceptsKey SourceSafe Concepts Setup: A Two-Step ProcessSetup: A Two-Step Process Visual SourceSafe, Editing Tools, and Visual SourceSafe, Editing Tools, and
the Working Folderthe Working Folder SourceSafe CommandsSourceSafe Commands Organizing Your FilesOrganizing Your Files The SourceSafe Explorer, Integration The SourceSafe Explorer, Integration
into Editing Environmentinto Editing Environment Version Numbers and LabelsVersion Numbers and Labels
66
MSTE
Key SourceSafe ConceptsKey SourceSafe Concepts
All your files are stored in a centralized All your files are stored in a centralized database on the serverdatabase on the server
Any kind of filesAny kind of files can be stored in can be stored in SourceSafe: code, DLLs, graphics, SourceSafe: code, DLLs, graphics, documents, help files, icons, …documents, help files, icons, …
A A projectproject is a collection of files in the is a collection of files in the SourceSafe database, analogous to a SourceSafe database, analogous to a folder in Windowsfolder in Windows
77
MSTE
Setup: A Two-Step ProcessSetup: A Two-Step Process
The The SourceSafe AdministratorSourceSafe Administrator runs runs SETUP.EXE from the CD and SETUP.EXE from the CD and chooses “Server Setup” to create the chooses “Server Setup” to create the SourceSafe database.SourceSafe database.
Each userEach user then goes to the server then goes to the server where the SourceSafe database was where the SourceSafe database was installed (installed (notnot from the CD), and runs from the CD), and runs NETSETUP.EXE to copy the NETSETUP.EXE to copy the executables to his local hard drive.executables to his local hard drive.
88
MSTE
Visual SourceSafe, Editing Visual SourceSafe, Editing Tools, and the Working FolderTools, and the Working Folder
You You storestore and and track track your your files in SourceSafe files in SourceSafe projectsprojects
You You editedit and and compilecompile your your files in the “working files in the “working folder” which your editing folder” which your editing tools seetools see
Your tool does not have to Your tool does not have to know about SourceSafe, know about SourceSafe, and vice-versa!and vice-versa!
Working Folder(eg C:\WORKING)
SourceSafeprojects(eg $/A/B)
99
MSTE
The Four Key CommandsThe Four Key Commands Get: Give me a local copy of a file or Get: Give me a local copy of a file or
project in my working folder, read-only, project in my working folder, read-only, to view or compileto view or compile
Check Out: Give me a local copy of a Check Out: Give me a local copy of a file or project, writable, to edit. (*May file or project, writable, to edit. (*May or may not be exclusive!)or may not be exclusive!)
Check In: Copy my edited file back into Check In: Copy my edited file back into SourceSafe, available to other users. SourceSafe, available to other users. (Stores old versions with (Stores old versions with reverse deltas.reverse deltas.)
Undo Check Out: Cancel my check out, Undo Check Out: Cancel my check out, voiding all the changes I madevoiding all the changes I made
1010
MSTE
Other Important CommandsOther Important Commands Create Project: Create a new projectCreate Project: Create a new project Add Files: Add files to a projectAdd Files: Add files to a project Delete: Delete a file or projectDelete: Delete a file or project Difference: Show me what changed Difference: Show me what changed
in this file or projectin this file or project Share: Copy files from other projects Share: Copy files from other projects
into the current projectinto the current project History: Show me all the versions of History: Show me all the versions of
this file or projectthis file or project
1111
MSTE
Organizing Your FilesOrganizing Your Files Your Your SourceSafe project structureSourceSafe project structure
should mirror your should mirror your local folder local folder structure structure (or directory tree)(or directory tree)
For instance, if your files are For instance, if your files are organized into one folder with three organized into one folder with three subfolders, create one SourceSafe subfolders, create one SourceSafe project with three subprojectsproject with three subprojects
Later, you may modify this a bit due Later, you may modify this a bit due to Sharingto Sharing
1212
MSTE
The Working FolderThe Working Folder Your working folder is where you keep Your working folder is where you keep
files locally. Get, Checkout, Check In, files locally. Get, Checkout, Check In, Difference, and other commands rely Difference, and other commands rely on it.on it.
You set it through the “Set Working You set it through the “Set Working Folder” dialog.Folder” dialog.
The working folder is stored The working folder is stored per userper user, , per project, per project, and and per machine.per machine.
Settings automatically propagate down Settings automatically propagate down the project treethe project tree
1313
MSTE
The SourceSafe ExplorerThe SourceSafe Explorer
1414
MSTE
Tips for Using the SourceSafe Tips for Using the SourceSafe ExplorerExplorer
Hold the “Shift” key down while selecting Hold the “Shift” key down while selecting any command, and you will get a “pre-any command, and you will get a “pre-dialog” before the command executes dialog” before the command executes (allowing you to select a date range for (allowing you to select a date range for History, a format for Diff, History, a format for Diff, etcetc)
Click on a project and choose a command, Click on a project and choose a command, and the command will act on the whole and the command will act on the whole project (project (egeg Get a project, view project Get a project, view project History, view project Difference)History, view project Difference)
1515
MSTE
SourceSafe Integration into SourceSafe Integration into Editing EnvironmentsEditing Environments
““Integration” means you can execute SourceSafe Integration” means you can execute SourceSafe commands directly inside your editing commands directly inside your editing environment.environment.
Some less commonly used commands still require Some less commonly used commands still require the SourceSafe Explorer.the SourceSafe Explorer.
This kind of integration is available through This kind of integration is available through Visual C++, Visual Basic, Access, FrontPage, Visual C++, Visual Basic, Access, FrontPage, Visual J++, Visual FoxPro, and others.Visual J++, Visual FoxPro, and others.
Macros are available for free on our Web page to Macros are available for free on our Web page to integrate with Office 97 and Word/Excel 95. integrate with Office 97 and Word/Excel 95.
1616
MSTE
Example: Visual SourceSafe Example: Visual SourceSafe Integration into Visual C++Integration into Visual C++
This picture shows a cool SourceSafe dialog coming up in the middle of Visual C++.
1717
MSTE
Version Numbers and LabelsVersion Numbers and Labels Version numbers count up automatically: 1, Version numbers count up automatically: 1,
2, 3, etc.2, 3, etc. User-defined version numbers are in the form User-defined version numbers are in the form
of of labelslabels such as “2.00b” or “Beta 2” on a file such as “2.00b” or “Beta 2” on a file or a projector a project
When you reach a project milestone or When you reach a project milestone or release, don’t create a new project, and don’t release, don’t create a new project, and don’t label the files. Label the project.label the files. Label the project.
Retrieving an old version of a project Retrieving an old version of a project recovers the files that recovers the files that were inwere in the project at the project at that timethat time
1818
MSTE
AgendaAgenda IntroductionsIntroductions Visual SourceSafe BasicsVisual SourceSafe Basics Advanced Visual SourceSafeAdvanced Visual SourceSafe QuestionsQuestions
1919
MSTE
Advanced Visual SourceSafe Advanced Visual SourceSafe
Web FeaturesWeb Features SharingSharing PinningPinning Branching/MergingBranching/Merging CustomizationCustomization The SourceSafe Command LineThe SourceSafe Command Line Other Advanced FeaturesOther Advanced Features
2020
MSTE
SourceSafe Web FeaturesSourceSafe Web Features
If you are using SourceSafe to manage If you are using SourceSafe to manage your Web site…your Web site…
““Deploy” copies your files to the live Deploy” copies your files to the live Web server (via folder path or FTP)Web server (via folder path or FTP)
““Check Hyperlinks” checks the validity Check Hyperlinks” checks the validity of of internalinternal links (to your own files) links (to your own files)
““Create Site Map” creates an HTML site Create Site Map” creates an HTML site map you can post on your pagemap you can post on your page
2121
MSTE
SharingSharing Sharing is how you track Sharing is how you track reusable filesreusable files Technically, sharing means that Technically, sharing means that one fileone file
is in is in multiple projectsmultiple projects at the same time at the same time All updates are automatically All updates are automatically
propagated, since there is only one filepropagated, since there is only one file There is no “master project”: all There is no “master project”: all
sharing projects are peerssharing projects are peers Use the “Links” tab (Options dialog) to Use the “Links” tab (Options dialog) to
track Shared filestrack Shared files
2222
MSTE
SharingSharing
““$/$/A and $/B share A and $/B share Fu.cpp” … or…Fu.cpp” … or…
““Fu.cpp is Fu.cpp is inin $/A and $/A and $/B”$/B”
In this picture, the file In this picture, the file has 5 versions. If has 5 versions. If eithereither project checks in the file, project checks in the file, bothboth projects will be on projects will be on version 6version 6
$/A $/B
5
4
3
2
1
Fu.cpp
2323
MSTE
PinningPinning
A pin says “Whatever other projects A pin says “Whatever other projects do, I am frozen at version do, I am frozen at version xx””
Pinning controls the pace at which Pinning controls the pace at which updates are receivedupdates are received
Pinning is controlled through the Pinning is controlled through the History dialogHistory dialog
When a file is pinned, you cannot When a file is pinned, you cannot check a file out: it is frozencheck a file out: it is frozen
2424
MSTE
PinningPinning
$/$/A shares the most A shares the most recent version of Fu.cpprecent version of Fu.cpp
$/B is pinned to version 4 $/B is pinned to version 4 of Fu.cppof Fu.cpp
$/A $/B
5
4
3
2
1
Fu.cpp
2525
MSTE
Branching/MergingBranching/Merging
Branching a shared file creates a new file Branching a shared file creates a new file in the SourceSafe databasein the SourceSafe database
Updates do not propagate now, and both Updates do not propagate now, and both files can be modified separatelyfiles can be modified separately
Don’t branch when you just need a pin!Don’t branch when you just need a pin! You can see the branch history of the file You can see the branch history of the file
by using the “Paths” tab in Propertiesby using the “Paths” tab in Properties Branching a project branches all the filesBranching a project branches all the files Later, you can merge the changes backLater, you can merge the changes back
2626
MSTE
BranchingBranching
After the file After the file branches, there are branches, there are two independent FU.C two independent FU.C files, one in each files, one in each projectproject
Versions 1-3 are the Versions 1-3 are the same: Versions 4-5 are same: Versions 4-5 are differentdifferent
$/A
5
4
3
2
1
Fu.cpp
$/B
Fu.cpp
5
4
3
2
1
2727
MSTE
Share/Pin/Branch ScenarioShare/Pin/Branch Scenario While working on version 4.0 of your While working on version 4.0 of your
project, you need to patch of version 3.0.project, you need to patch of version 3.0. So you So you share version 3.0 of the project.share version 3.0 of the project.
This creates a “patch” project where all This creates a “patch” project where all files are shared with the main line, but files are shared with the main line, but pinnedpinned to their versions from 3.0. to their versions from 3.0.
You can’t check out these pinned files. So You can’t check out these pinned files. So to modify a file on the patch, to modify a file on the patch, branchbranch it. it.
Later, you may Later, you may mergemerge these bug fixes these bug fixes back into the main lineback into the main line
2828
MSTE
CustomizationCustomization
This picture shows the first tab in the SourceSafe Options dialog. Play with the dialog to see the many ways you can customize SourceSafe!
2929
MSTE
The Visual SourceSafe The Visual SourceSafe Command LineCommand Line
All SourceSafe functionalityAll SourceSafe functionality fully fully available from the command line (except available from the command line (except some of the Web-specific features)some of the Web-specific features)
Great for macros, batch files, and Great for macros, batch files, and integration: also sometimes faster to use integration: also sometimes faster to use than the GUIthan the GUI
Commands look like “SS Get FU.CPP” Commands look like “SS Get FU.CPP” (means, “Get this file from the current (means, “Get this file from the current project into my current folder”)project into my current folder”)
3030
MSTE
Other advanced featuresOther advanced features ““Keyword expansion” puts version Keyword expansion” puts version
control information directly into control information directly into your source fileyour source file
““Shadow folders” create a public Shadow folders” create a public share that echoes a SourceSafe share that echoes a SourceSafe projectproject
““Project security” sets user rights on Project security” sets user rights on a project-by-project basisa project-by-project basis
““OLE Automation” lets you drive OLE Automation” lets you drive SourceSafe from VC++ or VBSourceSafe from VC++ or VB
3131
MSTE
Questions?Questions?
For more information, see: http://www.microsoft.com/ssafeFor more information, see: http://www.microsoft.com/ssafe