"Source code control" refers to the practice of storing files containing
program source code (and other project artifacts) in a common repository. Using
source code control (SCC), multiple developers can work on the same project
(including the same project file) at the same time. The SCC repository
can be queried for a detailed listing of the changes that occurred each time a
file was edited. Files under source code control that are open for
editing can also be reverted to their previous state.
Komodo's SCC integration works in conjunction with the
CVS and
Perforce source code control
systems. From within Komodo, you can perform the following SCC actions:
- check files out of the repository
- add files to the repository
- remove files from the repository
- compare files in the editor against their repository versions (a "diff")
- submit files back to the repository
- revert files to their previous state
Depots, repositories, branches, and projects cannot be created or configured
from within Komodo. This must be done using CVS or Perforce directly.
Source code control functions are accessible from the following locations:
- Toolbox Context Menu: Right-click a file in the
Toolbox to access the
Source Control menu options. Source code control functions
can also be performed on Folders in the Toolbox; right-click a folder and
select Source Control on Contents to access the menu.
- Project Manager context menu: Right-click a file in the
Project
Manager to access the Source Control menu options. SCC
functions can also be performed on Folders in the Toolbox; right-click a
folder and select Source Control on Contents to access the
menu. Two source code control options are available
from the Project Manager and Toolbox context menus:
- Source Control
applies source code functions to the selected file only.
- Source Control
on Contents applies source code functions to the contents of the
selected project or folder.
- Editor Pane: Right-click a file in the Editor Pane to
access the Source Control menu options.
- Filename Tab: Right-click the filename tab above the
Editor Pane to access the Source Control menu options.
- File Menu: Select the Source Control
option from the File menu.
The Source Control submenu options are the same regardless
of which method is used to access the menu.
To view the location of the CVS executable files found on your system and to
determine which executable is used, select Edit|Preferences|Source Code
Control|CVS. If CVS is not properly configured, or if the CVS
executable file you have is incompatible with Komodo, the CVS Source Code
Control page in Komodo Preferences displays a message advising that CVS
integration is disabled. To begin configuring CVS, click Download
CVS and follow the instructions on the ASPN web site.
On Windows, determine the version of cvs.exe installed on your
system by entering cvs -v at a command prompt. If this returns
Concurrent Versions System (CVSNT) rather than
Concurrent Versions System (CVS) , your CVS version is not
compatible with Komodo. Linux uses the standard version of CVS.
The CVS executable must be located in a directory specified in your
system's PATH environment variable.
On Windows 98 and Me, you must configure a HOME environment
variable, for example "HOME=c:\ ". Reboot before proceeding.
Some CVS repositories (e.g. SourceForge) will only support CVS access
over SSH (secure shell). When accessing these repositories, an SSH client is
required.
Putty is a free SSH, Telnet and Rlogin client for Windows.
1. Install Putty
Download Putty (version 0.52 or greater) and associated programs from:
http://www.chiark.greenend.org.uk/~sgtatham/putty/
To connect to a CVS server via SSH, the following programs are required:
- putty.exe
- puttygen.exe
- pageant.exe
- pscp.exe
- plink.exe
Ensure that the directory where Putty is installed is specified in your
system's PATH environment variable.
2. Generate the Putty Key
Run the puttygen utility. Configure as follows:
- Set Parameters: Select either "SSH2 RSA" or "SSH2 DSA".
- Generate Key Pair: Click the Generate button to
generate the key pair. While the key is being generated, move the mouse
pointer around the blank space to provide key randomness.
- Enter Key Passphrase: Enter and confirm a passphrase for the
key. Remember the passphrase - it is required later.
- Save Public Key: Click the "Save public key" button
and store the key in a file called public1.key.
- Save Private Key: Click the Save private key
button and store the key in a file called private1.key, in the
same directory as the public key.
- Copy Key Contents: Copy the contents of the public
key field (at the top of the dialog box) to a file named
public1-openssh.key. This key is required later.
- Close puttygen
3. Load and Configure the Putty Authentication Agent
Run the pageant program. This loads the Putty Authentication
Agent into the Windows System Tray.
Right-click the Pageant icon in the Windows System Tray. Select
Add Key. Navigate to the directory where you saved the public
and private keys in the previous step, and select the file
private1.key.
4. Configure Putty To Use Pageant
Run the putty program. Configure as follows:
- Specify CVS Server: On the Session
page of the Configuration form, enter the host name or IP address of the
CVS server.
- Specify Protocol: On the Session page,
in the Protocol field, select the "SSH" protocol.
- Create Saved Session: In the Saved Sessions
field, enter the host name again. Click the Save button.
- Configure Connection: on the Connection
page of the Configuration form, enter your username for the CVS server
in the Auto-login username field.
- Configure SSH Protocol: On the SSH
page of the Configuration form, specify "2" for the Preferred
SSH protocol version.
- Enable Agent Forwarding: On the Auth
page of the Configuration form, check Allow agent forwarding.
In the Private key file for authentication field, specify
the path and filename of the private key created above
(private1.key).
- Save Session Information: On the Session
page of the Configuration form, click the Save button.
5. Store Public Key on CVS Server
You must store the public key file generated in step 2
(public1-openssh.key) on the CVS server.
- Open Command Prompt Window: Type
cmd in the
Windows Run dialog box.
- Copy Public Key to Server: At the command prompt, enter:
pscp c:\path\to\public1-openssh.key username@cvs.server.com:public1-openssh.key
...where c:\path\to\public1-openssh.key specifies the location of the key
file created in step two, and username@cvs.server.com specifies your user name
on the CVS server and the URL of the CVS server. You are prompted to confirm
the legitimacy of the host, and may be prompted to enter your password
for the CVS server.
- Connect Using Putty: If necessary, run the
putty program. In the Saved Sessions field,
double-click the configuration created in Step 4. This establishes a
connection to the CVS server.
- Configure the Key on the Server: After logging on to the
CVS server, enter the following commands to configure the SSH key:
mkdir ~/.ssh
chmod 700 .ssh
cat ~/public1-openssh.key >> ~/.ssh/authorized_keys
rm ~/public1-openssh.key
chmod 600 ~/.ssh/*
- Log Off and Exit Putty: Enter
exit to close
the session of the server.
6. Test the Configuration
Restart Putty. In the Saved Sessions field,
double-click the configuration created in Step 4. You should not be prompted
to log in. If you are, the configuration failed. Review the steps above and
ensure that they were completed correctly.
7. Check Out a CVS Module
- Create Local CVS Directory: Create a directory to store a
copy of the CVS repository.
- Copy Files to Local Directory: At a command prompt, enter:
set CVS_RSH=plink
set PLINK_PROTOCOL=ssh
cvs -d :ext:username@cvs.server.com:/repository_name co cvs_module
...where username@cvs.server.com specifies your username
on the CVS server and the URL of the CVS server, repository_name
specifies the name of the repository on the server, and cvs_module
specifies the name of the module in the chosen working repository.
Login is handled by SSH. The files are copied to the local system. These
environment variables do not interfere with non-SSH repositories.
Ensure that these variables are permanently configured in your system
environment (for example, by adding them to the autoexec.bat file or
configuring them in the system properties). Reboot Windows Me and 9x systems
after adding environment variables.
8. Using Komodo and CVS
Before starting Komodo, perform the following steps:
If you are running Windows 9x or Windows Me, permanently configure these
variables in the environment (for example, by adding them to the
autoexec.bat file) and reboot before proceeding.
To configure CVS to use SSH, refer to
http://xml.apache.org/forrest/community/howto/cvs-ssh/howto-cvs-ssh.html.
On all platforms, create an environment variable as follows:
CVS_RSH=ssh
CVS determines when to use SSH, depending on how you check out
the modules. If you use the "cvs login" method with the "pserver" protocol, CVS
does not use SSH, even if CVS_RSH=ssh is set in the environment.
On Windows, also configure the cygwin SSH Agent as follows:
- Open a cygwin shell.
- Enter
exec ssh-agent bash .
- Enter
ssh-add .
- To check out a CVS module, enter:
cvs -d :ext:username@cvs.server.com:/repository_name co cvs_module
...where username@cvs.server.com specifies your username
on the CVS server and the URL of the CVS server, repository_name
specifies the name of the repository on the server, and cvs_module
specifies the name of the module in the chosen working repository.
- Start Komodo within the cygwin shell as follows:
/path/to/komodo/komodo.exe
After completing the configuration steps above, follow these steps
to open Komodo with CVS-SSH enabled:
- Open a cygwin shell.
- Enter
exec ssh-agent bash .
- Start Komodo within the cygwin shell as follows:
/path/to/komodo/komodo.exe
Ensure that the command-line version of Perforce ("P4") is correctly installed
and functional before working with a Perforce repository within Komodo. The
p4.exe file must be located in a directory that is specified
in your PATH environment variable.
Users of Perforce's P4CONFIG feature may find that Komodo's source code
control doesn't work unless Komodo is started from within the client view of the
Perforce repository.
Use the Source Code Control page in Komodo's
Preferences to configure
Source Code Control integration. To open the Komodo Preferences dialog box, select
Edit|Preferences.
Access common source code control commands from the
SCC Toolbar
at the top of the Komodo workspace. Refer to the command descriptions below
for more information. The toolbar commands only apply to the file currently
active in the Editor Pane.
To access source code control functions, select File|Source Control.
Invoke source code control context menus by right-clicking files
or folders in the following areas:
The SCC Output tab is located in the Bottom Pane of
the Komodo workspace. As you execute source code control commands, such as
editing or checking in files, details of the commands are displayed on the
SCC Output tab.
Error messages and warnings are also displayed on the
SCC Output tab. Additionally, error messages and warnings
are displayed on the status bar in the bottom left corner of the Komodo
workspace.
As described above, source code control commands are invoked from
the toolbar, the File menu and the Source Control context menu.
The following commands are available, depending on the context:
- Add: Add a file from a designated source code directory
on your local drive to the source code repository.
- Edit: Check out a file from the current source code
repository.
- Revert Changes: Check the file back into the
repository, abandoning any changes made since it was checked out.
- Remove: Delete the file from both the source code
repository and the corresponding local directory.
- Update: When the local version no longer matches the
repository version of a file, select this command to update the local version
of the file.
- Diff (Compare Files): Compare the version of a file open
in the Editor Pane with the version in the source code repository. Depending on
the setting in Preferences,
the diff display is shown on another Komodo editor tab or in a separate window.
If the display style for diffs (Edit|Preferences|Source Code
Control) is set to Create new window, press 'F9' or
select Jump to Corresponding Line to open and/or shift
focus to the original file in the Editor Pane. If viewing a diff in an editor
tab, right-click and select Jump to Corresponding Line to
shift focus to the editor tab containing the source code. Selecting this option
opens the source code tab in the Editor Pane if it is not already open.
- Commit Changes: Submit the file back to the source
code repository.
Under Perforce, to open files for edit from within a Komodo project,
you must first add files to the project using options on the
Project menu. To accomplish the same under CVS, use the
following procedure:
- At the command prompt, enter
cvs co <projname> to open
working copies of the files.
- On the Projects tab, right-click the project and select
Import from File System.
- In the Import from File System dialog box, specify the location
of the files to be imported and click Next.
- Click OK to confirm changes to the project.
If Perforce or CVS is enabled in Komodo's
Preferences, the status of
files in the source code repository is indicated by icons that appear on file
tabs in the Editor Pane and next to files and projects on the Projects tab.
The icons can appear in a variety of combinations, depending on the status of
the file and where they are displayed in the Komodo workspace. For example, a green
circle next to a padlock on a tab in the Editor Pane indicates that the file is
open for edit and that the version of the file in your local directory is in sync
with the version in the source code repository.
 |
The file is being added to the source code repository. |
 |
The file is being deleted from the source code repository. |
 |
The file is open for edit. |
 |
The version of the file in your local directory is in sync with
the version in the source code repository. |
 |
The file is read-only. |
 |
The version of the file in your local directory is out of sync with
the version in the source code repository. |
 |
There is a conflict between the version of the file in your local
directory and the source file that cannot be resolved by simply syncing your
directory with the source code repository. The discrepancy must be manually
resolved. |
|