Archive for the 'SourceSafe' Category

Oct 24 2008

Using Visual SourceSafe – Microsoft Source Code Control Interface (MSSCCI) Registry Entries

Published by under SourceSafe

This article is a part of SourceSafe / VSS Tutorial

MSSCCI Registry Structure
How to Edit/View the Registry
Improvement in Visual Studio 2005 and 2008

 

MSSCCI Registry Structure

MSSCCI uses registry to organize multiple SCC providers.

There are 3 elements in the registry:

1. The provider specific registry entries

For every SCC provider, there is a registry entry: HKEY_LOCAL_MACHINE\SOFTWARE\[company name]\[product name].

For Microsoft SourceSafe, that is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SourceSafe.

Under that entry, there are 4 sub entries: SCCServerName, SCCServerPath, HideInVisualStudio and DisableSccManager. SCCServerName is the name of the product. SCCServerPath is the full path to the SCC dll. HideInVisualStudio and DisableSccManager are not so commonly used.

The following is the screen shot of the SourceSafe/VSS MSSCCI registry:

SourceSafe/VSS MSSCCI registry
(SourceSafe/VSS MSSCCI registry)

 

Other MSSCCI provider has similar values. The following is the screen shot of the SourceAnywhere MSSCCI registry:

SourceAnywhere MSSCCI registry
(SourceAnywhere MSSCCI registry)

 

2. The central place to list all the providers

All of the SCC providers are listed under the HKEY_LOCAL_MACHINE\SOFTWARE\SourceCodeControlProvider\InstalledSCCProviders entry. Under the InstalledSCCProviders entry, there are list of [display name] = [the path to the provider specific registry entry]. The following is the screen shot:

The installed SCC providers in the system
(The installed SCC providers in the system)

 

3. The entry to specify the current provider

Finally, there must be an entry to specify which provider is the current provider in the system. The pattern is HKEY_LOCAL_MACHINE\SOFTWARE\SourceCodeControlProvider\ProviderRegKey = [the path to the provider specific registry entry].

The following is the screen shot of my machine that specifies that SourceSafe is the current provider:

MSSCCI Provider RegKey

 

How to Edit/View the Registry

We can use regedit.exe to edit or view the registry.

 

Improvement in Visual Studio 2005 and 2008

From the above, we know that there is only one HKEY_LOCAL_MACHINE\SOFTWARE\SourceCodeControlProvider\ProviderRegKey entry, which means that we can only have one default SCC provider in the system. If we have two projects that use two different MSSCCI providers, we have to switch the current provider when we open a different project.

Since Visual Studio 2005, Microsoft made improvement by writing the SCC provider info in the solution file. This way, the SCC provider information is solution specific. Different solutions can use different source control providers without switching provider info in the registry.

For how to choose the SCC provider in Visual Studio 2005 and 2008, please refer to the article Switching Visual Studio projects from SourceSafe to other SCC providers. The url is:
http://www.kevingao.net/sourcesafe/switching-visual-studio-projects-from-sourcesafe-to-other-scc-providers.html

 

SourceAnywhere - the SQL Server-based SourceSafe Replacement The SQL Server-based source control Software Designed to be a SourceSafe Replacement SourceAnywhere for VSS - the Fastest SourceSafe Remote Access Tool Recommended by Microsoft The Fastest SourceSafe Remote Access Tool Recommeded by Microsoft

Links:
Previous article <<<<: Introduction to Microsoft Source Code Control Interface (MSSCCI)
Next article >>>>: A Free Tool to Manage the MSSCCI Provider (with full Source Code)
SourceSafe How To series home page: VSS / SourceSafe Tutorial

3 responses so far

Oct 24 2008

Using Visual SourceSafe – Introduction to Microsoft Source Code Control Interface (MSSCCI)

Published by under SourceSafe

This article is a part of SourceSafe / VSS Tutorial

MSSCCI stands for Microsoft Source Code Control Interface. The latest version of MSSCCI is 1.3.

In Visual Studio 6 and 2003/net, MSSCCI is the only option to integrate source control features into Visual Studio. In Visual Studio 2005 and 2008, we can use VSPackage or MSSCCI to integrate source control features into Visual Studio.

Visual Studio and MSSCCI
(Visual Studio and MSSCCI)

 

VSPackage is a new way to extend Visual Studio and is much more complex than MSSCCI. The newer version of SourceAnywhere will use VSPackage to provide better integration with Visual Studio.

MSSCCI has been around for more than a decade and is supported by many development products, like PowerBuilder, IBM Rational product line and Visual Studio.

MSSCCI was available only to VSIP (Visual Studio Industry Partner) members. To download the specification, you needed to sign a NDA (non-disclosure agreement) with Microsoft. Now, the specification is freely available at http://msdn.microsoft.com/en-us/library/bb166170(VS.80).aspx

Microsoft is opening up gradually and slowly. :-)

 

SourceAnywhere - the SQL Server-based SourceSafe Replacement The SQL Server-based Source Control Software Designed to be a SourceSafe Replacement SourceAnywhere for VSS - the Fastest SourceSafe Remote Access Tool Recommended by Microsoft The Fastest SourceSafe Remote Access Tool Recommeded by Microsoft

Links:
Previous article <<<<:
Next article >>>>: Microsoft Source Code Control Interface (MSSCCI) Registry Entries
SourceSafe How To series home page: VSS / SourceSafe Tutorial

One response so far

Oct 16 2008

Using Visual SourceSafe – Cloak

Published by under SourceSafe

This article is a part of SourceSafe / VSS Tutorial

Cloak is a useful little function in version control. It allows us to specify the projects to be ignored during recursive operations such as Get, Check In, Check Out, and Undo Check Out.

 

Why Cloak

Some of the subprojects may never or rarely be used. However, when we do some recursive operations like Get, all the sub files and folders are operated.

For example, the help document needs to be updated whenever a new release comes out. It takes a long time to get the whole project of the help document, especially the image files. To improve efficiency, we can put all the image files in a subproject and cloak it. This way, the subproject cloaked will not be downloaded to local when getting the whole project.

 

To Cloak a Visual SourceSafe Project

To cloak a project, we need to launch the Project Properties dialog first: right click the target project and select Properties.

Cloak – Launch the project Properties dialog
(Cloak – Launch the project Properties dialog)

 

In the General tab of the project Properties dialog, we check the This project is Cloaked for me checkbox to cloak a project, as seen in the following figure:

Cloak a Visual SourceSafe project
(Cloak a Visual SourceSafe project)

 

When a project is cloaked, the icon of the project is turned to grey. To de-cloak a project, just simply uncheck the This project is Cloaked for me checkbox in the project Properties dialog.

 

How Cloak Works

If a project is cloaked, Get, Check In, Check Out, Undo Check Out, and Project Difference operations do not apply to the project when we do these operations on the cloaked project’s parent project. But when we do these operations on the cloaked project itself, these commands still work as normal.

For example: Suppose that we work on a project called $/OurApp. In this project there are subprojects called Code and Tests that we need and another subproject called Docs, which we almost never use. Now, we cloak the Docs project and recursively Get $/OurApp, the Docs project (and its subprojects) will be ignored.

How Cloak Works

 

However, it does not mean that we cannot get a cloaked project. For example, if we want to get all the sub files and folders in the $/OurApp/Docs project which is cloaked, we can make the focus on the project (like clicking on the project) and then perform Get operation.

Once a project is cloaked, VSS will record the name and location of the project. If you delete or purge the project and create a new project with the same name in the same location, VSS will cloak the new project automatically. If a project is renamed or moved, the project will lose the cloak information. So besides unchecking the This project is Cloaked for me checkbox in the project Properties dialog, we can rename or move the project to another place to de-cloak a project. ^_^

 

SourceAnywhere - the SQL Server-based SourceSafe Replacement The SQL Server-based source control Software Designed to be a SourceSafe Replacement SourceAnywhere for VSS - the Fastest SourceSafe Remote Access Tool Recommended by Microsoft The Fastest SourceSafe Remote Access Tool Recommeded by Microsoft

Links:
Previous article <<<<: Branch in SourceSafe / VSS
Next article >>>>: Label in SourceSafe / VSS
SourceSafe How To series home page: VSS / SourceSafe Tutorial

Comments Off

Oct 16 2008

Using Visual SourceSafe – Branch

Published by under SourceSafe

This article is a part of SourceSafe / VSS Tutorial

As we talked about in our last post Share, share is only a small function in version control. It should be combined with Branch to play a greater role. This article will talk about the following topics: Introduction to Branch, Why Branch, How to Branch and How to Track Different Branches.

 

Introduction to Branch

After a file is shared in several projects, modifications to the file in one project are automatically propagated to all sharing projects. This feature has great advantages in some cases. However, sometimes we may want the file and its counterparts to be independent. That is when Branch comes to handy.

VSS allows us to branch a shared file with the Branch command. After branching, the file and its counterparts will be independent, and changes made to the file will not be reflected elsewhere. We can use Merge Branches to merge the branches back.

 

Why Branch

The Visual SourceSafe Branch command breaks the shared link between copies of the file, making the file versions independent and able to be part of separate projects. Here are two common scenarios in which we need Branch:

  • Suppose that after we released a new Version 3.0, the R&D team starts working toward the next major release, the 4.0 version with new features and functions. We can implement it by branching all files into a new project $/Project4. If our users find bugs or need minor features in Version 3.0, we may need to work out a maintenance version, say, Version 3.1. In this case, we can create a new project named $/PATCH to represent the 3.1 version, and branch all the files from Version 3.0. Then some specific developers can fix bugs in the PATCH project while the other team members stay on the 4.0 version development.

Branch scenario 1
(Branch scenario 1)

  • Suppose that we are working on two projects which are virtually identical for two clients. We need to tailor program behavior in one or two files. First, we share the project $/CLIENT1 to a new project $/CLIENT2 recursively. Next, we select the few files we want to tailor in $/CLIENT2 and branch them. Now, when we modify these specific files in $/CLIENT2, the changes do not propagate to $/CLIENT1. All the other files, however, are still shared between the two projects. So, if we modify any of the shared files, the changes will be propagated.

 

How to Branch

How to Branch Shared Files

Visual SourceSafe allows us to branch a shared file using the Branch command:

  1. Select the shared file(s) to branch in Visual SourceSafe Explorer.
  2. On the Versions menu, click Branch.
  3. On the Branch dialog box, type a comment in the Comment box if necessary. Then we can click OK to finish the operation.

Branch shared files using versions menu
(Branch shared files using versions menu)

 

How to Share and Branch

The Share command supports branching of a file immediately after sharing it. To share and branch, we can use Share on the Versions menu:

  1. In VSS Explorer, select the project to which the file(s) is branched.
  2. On the Versions menu, click Share to.
  3. In the Share to dialog box, use the File to share box to select the name of the file to share with the selected project.
  4. Click Share with the Branch after share option checked.

Branch after share
(Branch after share)

 

OR, we can use drag and drop:

  1. In Visual SourceSafe Explorer, right-click a file.
  2. Drag the item over the receiving project and drop the item.
  3. In the resulting menu, click Share and Branch.

 

How to Track Different Branches

When we branch a file after sharing, the Links tab for file properties no longer shows a file relationship. However, we can track the different branches by right-clicking on the branched file, and then clicking Properties -> Paths tab.

Branch links
(Branch links)

 

After the file branches are modified in different projects separately, we can bring them back together using the Merge Branches command. To learn more details, please refer to another article File Merge.

 

SourceAnywhere - the SQL Server-based SourceSafe Replacement The SQL Server-based source control Software Designed to be a SourceSafe Replacement SourceAnywhere for VSS - the Fastest SourceSafe Remote Access Tool Recommended by Microsoft The Fastest SourceSafe Remote Access Tool Recommeded by Microsoft

Links:
Previous article <<<<: Share in SourceSafe / VSS
Next article >>>>: Cloak in SourceSafe / VSS
SourceSafe How To series home page: VSS / SourceSafe Tutorial

6 responses so far

Oct 15 2008

Using Visual SourceSafe – Switching Visual Studio projects from SourceSafe to other SCC providers

Published by under SourceSafe

This article is a part of SourceSafe / VSS Tutorial

If you previously used SourceSafe to source control your Visual Studio projects and then find a better source control tool, you may need to switch the projects under SourceSafe to the new SCC (source code control) provider.

In the following steps, I use SourceAnywhere Standalone, the SQL-based SourceSafe replacement/alternative, as the target source control provider.

 

Switching Visual Studio 2005/2008 projects
Switching Visual Studio .NET 2003/Visual Studio 6.0 projects

 

For Visual Studio 2005/2008

1. Open the solution in Visual Studio.

2. Make the solution and project files writable so that the unbind info can be written. You can check out the solution recursively. Or at a minimum you should check out the solution and project files. Or you can modify the file attribute to be writable manually.

Check out the solution
(Check out the solution)

 

3. Unbind the solution and projects from SourceSafe through Visual Studio menu File -> Source Control -> Change Source Control.

Unbind VS2008 solution/project
(Unbind VS2008 solution/project)

 

4. Close Visual Studio and then re-open it.

5. Select SourceAnywhere Standalone as the current source control plug-in through Visual Studio menu Tools -> Options -> Source Control.

Select SourceAnywhere Standalone as the current source control plug-in
(Select SourceAnywhere Standalone as the current source control plug-in)

 

6. Add the solution into the source control of SourceAnywhere Standalone. You can right-click the solution file in the Solution Explorer and click Add Solution to Source Control. Or you can find the option through Visual Studio menu File -> Source Control.

Add solution into source control of SourceAnywhere Standalone
(Add solution into source control of SourceAnywhere Standalone)

 

For Visual Studio .NET 2003/Visual Studio 6.0

1. Open the solution in Visual Studio.

2. Unbind the solution and projects with SourceSafe.

  • For Visual Studio .NET 2003, go to menu File -> Source Control -> Change Source Control.

Unbind VS 2003 solution/project
(Unbind VS 2003 solution/project)

 

  • For Visual Studio 6.0, click menu Project -> Source Control -> Remove from Source Control.

Remove VS 6.0 files from source control
(Remove VS 6.0 files from source control)

 

3. Close Visual Studio.

4. Choose SourceAnywhere Standalone as the current SCC provider.

To do that, you can use the SCC Provider Manager utility which can be launched from the SourceAnywhere Standalone Client program group.

Choose SCC Provider using SCC Provider Manager
(Choose SCC Provider using SCC Provider Manager)

Or you can do it through registry: http://support.microsoft.com/kb/319318

5. Open the solution in Visual Studio.

6. Add the solution into the source control of SourceAnywhere Standalone.

  • For Visual Studio .NET 2003, right-click the solution file in the Solution Explorer and click Add Solution to Source Control or click menu File -> Source Control -> Add Solution to Source Control.

Add VS 2003 solution into source control of SourceAnywhere Standalone
(Add VS 2003 solution into source control of SourceAnywhere Standalone)

 

  • For Visual Studio 6.0, right-click the files and click Add to Source Control or click menu Project -> Source Control -> Add to Source Control.

Add VS 6.0 files into source control of SourceAnywhere Standalone
(Add VS 6.0 files into source control of SourceAnywhere Standalone)

 

Now the solution is in the source control of SourceAnywhere Standalone. And next time you open the solution, Visual Studio will prompt the Login dialog box of SourceAnywhere Standalone to connect to the server.

 

SourceAnywhere - the SQL Server-based SourceSafe Replacement The SQL Server-based Source Control Software Designed to be a SourceSafe Replacement SourceAnywhere for VSS - the Fastest SourceSafe Remote Access Tool Recommended by Microsoft The Fastest SourceSafe Remote Access Tool Recommeded by Microsoft

Links:
Previous article <<<<: Using SourceSafe in Visual Studio 2005 & 2008
Next article >>>>: Integrating SourceSafe / VSS with Visual C++ 6.0
SourceSafe How To series home page: VSS / SourceSafe Tutorial

One response so far

Sep 28 2008

Using Visual SourceSafe – Share

Published by under SourceSafe

This article is a part of SourceSafe / VSS Tutorial

In version control, Share enables files to be shared among multiple projects. It creates share links among these projects, so that the item can be viewed in all projects. If an item is modified in one project, the changes will be reflected in other projects simultaneously.

To use the Share command, we must have the Check Out/Check In right in the project we are sharing from, and the Add/Rename/Delete right in the project to which we are sharing.

 

Why Share

Consider a scenario in which your team develops several projects at the same time, and they all use one header file named common.h. You can share common.h in all projects. That way, any change made to common.h in one project is immediately propagated to all other projects. The file in all projects will always keep the same content.

If we do not use the Share command, we may need to copy the shared files to other projects. This will cause a problem: We need to synchronize the file manually every time we make changes to the file.

Now we can understand Share better. Share command enables files to be viewed/ modified in multiple projects at the same time.

 

How to Share file(s)

To share an item, we can use Share command on the Versions menu.

  1. In Visual SourceSafe Explorer, select a project to share the file(s) to.
  2. On the Versions menu, click Share to.
  3. In the Share to dialog, choose the project from which you want to share the file(s) in the Projects box, and then select files in the File to share box. You can check the Branch after share option if you need to branch the file(s).

    Share Using Versions Menu
    (Share using Versions menu)

     

  4. Click Share to share the selected file.

 

However, there is an easier way to perform the Share command. We can Share the file(s) using drag-and-drop:

  1. In Visual SourceSafe Explorer, right-click an item.
  2. Drag the item over the receiving project and drop the item.
  3. In the resulting menu, click Share.

Share using drag and drop
(Share using drag and drop)

 

 

How to Find the Share Links

After we shared the file(s), we may want to know which projects the file(s) are shared in. In Visual SourceSafe explorer, we can right-click on a shared file and click Properties -> Links tab, thus all share links for the selected file will be displayed. A share link is a Visual SourceSafe path to a project that shares the file with other projects.

Share links
(Share links)

 

 

How Project Share is performed in VSS

According to the Visual SourceSafe help file, VSS supports file and recursive project sharing. This makes Share in VSS very convenient and efficient.

However, please be advised that VSS does not truly share projects. Instead of sharing project structure, VSS shares project through sharing all of its subsidiary files (recursively). So, if we change the project structure by adding or deleting a file, the change will not be reflected in other shared projects.

Share needs to be combined with Branch to play a greater role. We will go into details of Branch in my blog later. Please continue to pay attention.

 

SourceAnywhere - the SQL Server-based SourceSafe Replacement The SQL Server-based source control Software Designed to be a SourceSafe Replacement SourceAnywhere for VSS - the Fastest SourceSafe Remote Access Tool Recommended by Microsoft The Fastest SourceSafe Remote Access Tool Recommeded by Microsoft

Links:
Previous article <<<<: Project Diff in SourceSafe / VSS
Next article >>>>: Branch in SourceSafe / VSS
SourceSafe How To series home page: VSS / SourceSafe Tutorial

8 responses so far

« Prev - Next »