Getting Started With Plastic SCM Plugin For Visual Studio

By definition, all Software Configuration Management (SCM) systems manage your source code, but each system has its own unique way of organizing the development environment. Plastic SCM provides a comprehensive integration with Visual Studio 2005 and later versions using a Visual Studio Extensibility Package. This integration offers the user most of the functionality found in the Plastic SCM GUI right inside Visual Studio.

Getting up to speed with Plastic SCM for Visual Studio is quick and easy, enabling you to start programming right away. By following the three simple steps listed below, you will be up and running with Plastic SCM in no time:

  1. Install the Plastic SCM plugin for Visual Studio.
  2. Select Plastic for your source code management.
  3. Create your workspace and start coding.

So let's get started!

1. Install the Plastic SCM plugin for Visual Studio

When you first launch the Plastic SCM installation you will need to accept the End User License Agreement (EULA) that will bring you to the components selection window. In this window you will be presented with a list of components to choose from. For instance if you want to install the client and server on the same machine then select “server components”. Other choices include plugins for Office and IDEs, the choice is up to you. If you already have a Visual Studio version greater than or equal to Visual Studio 2005, the setup will automatically select the plugins needed to work with Plastic SCM as shown inside the Blue box:

plugin for Visual Studio

Once the installation is complete you can open Visual Studio and begin working with Plastic SCM to manage your code development.

2. Select Plastic for your source code management

The tight integration of Visual Studio with TFS and Visual Studio Online offer a basic set of source code management tools but if you want to move beyond the ordinary to the extraordinary then you need to install Plastic SCM. With the plugin you will gain access to an extensive list of source code management tools that will deliver higher levels of productivity for you and your team. Gaining access to the advanced tool set is simple.
The first step is to go to the Visual Studio configuration options (Tools > Options) and in the new window select “Source Control” from the left panel tree view:

source code management

The next step is to select “Plastic SCM Source Control Package” from the “Current source control plug-in” dropdown list. After performing this action you will see that a new “Plastic SCM Settings” option has been added to the “Source Control” tree view node:

public SCM Settings

With the Plastic SCM settings option activated you have access to the advanced preferences for Plastic SCM. Additionally, you can select the option to delete files in Plastic SCM as soon as they are deleted in Visual Studio.

At this point you have successfully completed the majority of the installation and configuration. With just one more step you will be done and you can start coding!

3. Create your workspace and start coding

You are now ready to create a project and get to work! The Plastic SCM tool makes the process of creating and configuring your working environment simple and easy.

You start creating your project by opening the Visual Studio Solution Explorer and right-clicking on the “solution name” then selecting the “Add to source control” option. A new window called “New workspace” will pop up as in the following:

workspace and start coding

The options available to you in this window include the following:
  • Giving your workspace a custom name.

  • Defining the path to your workspace on local disk.

  • Selecting the default repository (local or remote).

  • Create your new repository by selecting “New..” that will open a new window where you will specify a repository name and the Plastic SCM repository server as in the following:

SCM repository server

Once you have entered the required information in each field you can press OK to return to the previous screen and OK again to close the window and add your new workspace (project) to the Plastic SCM AwesomeRepository you just created. You can verify that it was added correctly with no pending changes by opening the Solution Explorer to view the new project that will have a locker icon:

solution explorer

With the setup complete, every modification you make to the project will be registered, which means that whenever you modify a file in the project, the locker icon will change to a Red check mark to indicate that there are pending changes. You can right-click on the “solution” or the “project” or the “modified file” and select the “checkin…” option, to show the Plastic SCM Pending Changes screen:

Pending Changes screen

You can add a comment and click on the “Checkin” button to save your changes in the repository. You can also click on the “undo changes” button if you want to dismiss the pending changes and use the current repository version.

In addition to the “checkin...” option, there are several additional options to choose from in the Solution Explorer contextual menu, these include:

Undo checkout: Allows you to undo all the changes made in the file and place the latest checked version on the server.

Update to latest version: Allows you to query the server for the last version available for a file or project and merge the latest version with your actual workspace version.

The Plastic SCM submenu: Offers a wide range of functions for working with your files. What follows is a brief explanation of each of those functions.

Diff with previous: Displays a new vertical split screen with the previous version of the file stored in Plastic SCM and your current workspace version, showing the differences between them, as in the following:

Diff with previous

Diff:
Is similar to the “Diff with previous” but with this function you need to first select the version to compare with. You can compare with two older versions, between your workspace version and an old version or you can also search by various terms.

Annotate: Allows you to open a view of the selected file showing information about all the changes that were made to it. Each line displays the user, changeset and branch as in the following:

Annotate

History: Shows you a view with all of the changesets affecting the selected file.

Change revision type: allows you to switch between text or binary types.

Refresh status: updates the file status.

Permissions: displays the current permissions for the selected file, specifically which users and branches have rights to change, move, add, and so on.

Permissions

Identifying files that were added to source control

The Plastic SCM Visual Studio plugin makes it easy for you to add or remove files from version control. You don't need to configure exclusion rules for bin or obj folders or for files like suo or ide. The Plastic SCM items view enables you to easily manage your files and folders.

Referring to the Plastic SCM items view, you will notice that each file and folder can have a status of either Private or Controlled. The Private status means that the file/folder is not under source control. The Controlled status means that the file/folder is under source control so any changes made will be indicated on the folder or file icon:

Identifying files

If you edit a controlled file and return to the Plastic SCM items view, you will notice that the status column will contain additional information about the changes made to the file/folder.

The parent folders where the edited file is located will display the additional status “Contains changes”. This means that there are controlled files that were edited in the local workspace and not checked in. An edited file will display a status of “Checked-out”.

Using this example, you could use the Plastic SCM native management tool to take a look at the pending changes or you could also use branch explorer to see a graphical representation of your branches and many other options like repositories, workspaces or changesets:

changesets

Most of the information presented so far is available from within Visual Studio however Plastic SCM delivers additional management tool options that will enable you to have even greater control over your environment. By simply using the VIEW menu in Visual Studio you will see the Plastic SCM submenu that contains many of the powerful management tool options that will enable you to create a customized view of your development environment.

Referring to the screenshot you can see a customized view that was created using the Plastic SCM management tool options. In this view:

  • The window in the top left corner shows you the changesets for your workspace.

  • The window to the right of the changesets will show you the current pending changes in the workspace. This window is updated automatically every time you edit, add, remove or move a file in your workspace. Every change is tracked and shown there.

  • The window in the bottom left corner is the graphical Branch explorer where you can see the branches of this repository. Your current active branch and all other branches are organized using a timeline legend located at the top of the window. This way you can keep track of what branch was created each day.

  • The window to the right of the Branch explorer contains an integrated items view for quick and easy access.
Branch explorer contains

All of the windows in this customized view are full-featured Visual Studio native windows. You can pin or unpin them, make them float or stack one on top of each other to create a fully customized development experience.

Success!

You are now ready to go with a fully configured environment with Plastic SCM as your source code management solution and Visual Studio as your IDE. In three simple steps you were able to install the Visual Studio plugin, configure the source control solution in Visual Studio and create your workspace and repository. So start coding!


Similar Articles
DevsDNA
Development, training and mentoring company focused on Mobile and Augmented reality