CodeCharge Studio

Using the Source Control

Source Control integration is one of the new CodeCharge Studio 5 features making collaborative web site development a breeze. Integration with popular Software Configuration Management packages that are in use by most software development companies makes the CodeCharge Studio 5 professional IDE ideal for teams working on large web systems. CodeCharge Studio 5 integrates basic operations for retrieving current version, committing new versions and updating files in shared remote repositories.

Source control basics

Software Configuration Management includes two important aspects: keeping track of any changes made to project files and providing access to project files for team members. Version tracking means that the Software Configuration Management system makes it possible to retrieve any historical version of any project file or even a state of the files at some moment in time.

Most Software Configuration Management packages rely on a central installation called Repository that stores all the information about file changes, including the time and users making these changes.

Users working on the files in the repository need to download its current state locally to their computers. This operation is usually called Update or Get Lastest Version and creates a working copy. Before a file can be modified it has to be locked for editing using Edit or Check Out operation, depending on the Software Configuration Management package being used. To publish the changes to the repository, Commit or Check In operation must be executed. These operations are also required after adding new files to the repository.

Reserved vs. unreserved checkout systems

There are generally two kinds of Software Configuration Management systems. Packages with reserved checkout prevent multiple users from editing the same file at the same time. This is assured by putting a lock on a file before editing. Other users must wait for the editor to release the lock before they can edit the file. Source Control packages with unreserved checkout allow editing of any files in use by another user. Potential problems and conflicts are detected during the commit stage. The system checks if different users have not committed newer file version than the file being committed is based on. If this situation is detected, the committing user is left to perform a manual merge operation between the new file in the repository and the version that is being committed.

Most popular Software Configuration Management systems

Microsoft Visual SourceSafe

Visual SourceSafe is a Software Configuration Management package sold by Microsoft. It is a reserved checkout system often used with Microsoft Visual Studio because of good integration.

SourceGear SourceOffSite

Third-party solution developed by SourceGear to access remote Visual SourceSafe repositories over the Internet. Improved security and performance over Visual SourceSafe client. Uses reserved checkout.

Concurrent Versioning System

Concurrent Versioning System (CVS) is one of the most popular Software Configuration Management solutions available for free (and with source code). CVS is used in thousands of projects and has been made available by many hosting providers. This system uses unreserved checkouts with alternative file locking. Mature and reliable solution. The support for this tool is built-in inside CodeCharge Studio.

Note: There are many other Software Configuration Management systems available. They can be used with CodeCharge Studio provided their developer or a third-party has implemented Microsoft's SCC API handler to access their functionality from an IDE. Both Microsoft Visual SourceSafe and SourceGear SourceOffSite are accessed through such handlers and are listed in CodeCharge Studio only after installing client applications for these tools.

File status indicators available in CodeCharge Studio 5

Files in CodeCharge Studio 5 controlled project may have different statuses. The current status is represented by an indicator icon displayed in the Project Explorer right beside the item's icon. The indicators are available in both Page and File views.

Note: The page node sometimes represents multiple files and additional indicators are available to show that some files under the page node have a different status than the page file itself (exclamation mark indicator).

Indicator Meaning
The page/file is not under Source Control.
The page/file has been added. (CVS only)
The page has been added. (CVS only) There are files with different statuses for this page.
The page/file is ready for editing. (CVS only)
The page is ready for editing. (CVS only) There are files with different statuses for this page.
The page/file is locked in server/checked in.
The page is locked in server/checked in. There are files with different statuses for this page.
The page/file was changed locally/checked out.
The page was changed locally/checked out. There are files with different statuses for this page.
The page/file is checked out to another user.

File state transition diagram (CVS)

The CVS Software Configuration Management system uses unreserved checkout and offers more complex locking and file state transition. CodeCharge Studio 5 CVS plug-in uses additional states for uncommitted added files (repository is notified that a file is added, but file contents have not been committed yet) and for changed file (changed locally, not committed, potentially in conflict with new version available in the repository). The operation names used by CVS plug-in are also different from the names used by other Source Control providers. Commit operation is used for sending new file version to the repository and Update operation is used to retrieve current file version from the repository. CVS built-in locking is supported with Edit/UnEdit operations to lock and unlock a file.

File state transition diagram (non-CVS)

Non-CVS Source Control providers use simpler state transition assuming file is locked exclusively for editing (reserved checkout). Check In operation is used to put new file version into repository and Check Out operation is used to lock file for editing. Current file version can be retrieved using Get Latest Version operation.

Comparison of operations available for CVS and non-CVS Source Control providers

CVS command non-CVS command Description
Commit Check In Upload new version to the repository.
Edit Check Out Lock file for local editing.
UnEdit Undo Check Out Unlock file restoring original version
Update Get Latest Version. Get current version from repository
Add to Source Control Add to Source Control Add new file to the repository

Working with Source Control

How to create a new project or open an existing project under source control?

  1. Make sure default Source Control provider is configured properly.
  2. Open existing project or create new project using File/New/Project menu item.
  3. Open Project Settings dialog and choose Source Control section or right-click project node in the Project Explorer choosing Add to Source Control command to use default Source Control provider.
  4. Select the option Enable Version Control for the project and configure chosen Source Control provider.
  5. Depending on the Source Control, a dialog will be displayed for the user to choose files to be added to version control.

How to retrieve existing project from the repository?

  1. Create new project matching the project's name from the repository and remove blank NewPage1 page created by default.
  2. Open Project Settings dialog and choose Source Control section or right-click project node in the Project Explorer choosing Add to Source Control command to use default Source Control provider.
  3. Select the option Enable Version Control for the project and configure chosen Source Control provider.
  4. Let CCS retrieve the files from the repository or use Get Latest Version/Update operation selecting the project node.
  5. Right-click project root node in the Project Explorer view and choose Refresh command to get the tree refreshed with downloaded files.

How to add new page to source control?

  1. Make sure your project is added to Source Control.
  2. Choose a folder you want to add page to in the Project Explorer.
  3. Right-click the folder and choose New Page command or use File/New/Page menu.
  4. Configure page name and template confirming page creation.
  5. Depending on the Source Control setup dialog will be displayed to choose the files to add to the repository.
  6. If add prompt is disabled page files can be manually added to the repository right-clicking the new page and choosing Add to Source Control command.
  7. When using CVS plug-in pages need to be Committed before editing.

How to modify a page under source control?

  1. If a page is locked or partially locked it needs to be marked for editing choosing Check Out (non-CVS) or Edit (CVS) commands from the context menu.
  2. Page can be modified now. If events are added to the page, a prompt may appear asking to add new event-related files to the repository.
  3. After making changes, the page should be inserted into repository using Check In (non-CVS) or Commit (CVS) commands.

How to commit new project version?

  1. Unlock, modify or add pages and files needed for new functionality keeping them unlocked until tested.
  2. Right-click project node in the Project Explorer to execute Check In/Commit operation for all the files in the project at once.
  3. Make sure to provide comment to describe the functionality and modifications made.

See also

On-line, printable versions and updates