12. Version Control System
GPS offers the possibility for multiple developers to work on the same project,
through the integration of version control systems (VCS). Each project can be
associated to a VCS, through the VCS
tab in the Project property
editor. See section 7.7 The Project Properties Editor.
The systems that are currently supported in GPS are CVS and ClearCase.
It is recommended that you first get familiar with the version control
system that you intend to use in GPS first, since many concepts used in GPS
assume basic knowledge of the underlying system.
Associating a VCS to a project enables the use of basic VCS features on the
source files contained in the project. Those basic features typically include
the checking in and out of files, the querying of file status, file revision
history, comparison between various revisions, and so on.
Administration of VCS systems is not handled by GPS at this
stage. Therefore, before working on a project using version control
system, make sure that the system is properly set-up before launching
GPS.
Note: the set-up must make sure that the VCS commands can be launched without
entering a password.
12.1 The VCS Explorer
The VCS Explorer provides an overview of source files and their status.
The easiest way to bring up the VCS Explorer is through the menu
VCS->Explorer
. The Explorer can also be brought up using the
contextual menu Version Control->Query status
on files,
directories and projects in the file and project views, and on file
editors. See section 12.3 The Version Control Contextual Menu.
The VCS Explorer contains the following columns:
- Status
- Shows the status of the file. This column can be sorted by clicking on
the header. The different possible status for files are the following:
Unknown
- The status is not yet determined or the VCS repository is not able to
give this information (for example if it is unavailable, or locked).
Not registered
- The file is not known to the VCS repository.
Up-to-date
- The file corresponds to the latest version in the corresponding branch
on the repository.
Added
- The file has been added remotely but is not yet updated in the local
view.
Removed
- The file still exists locally but is known to have been removed from
the VCS repository.
Modified
- The file has been modified by the user or has been explicitly opened
for editing.
Needs merge
- The file has been modified locally and on the repository.
Needs update
- The file has been modified in the repository but not locally.
- Log
- This column indicates whether a revision log exists for this file.
- File
- The name of the file. This column can be sorted by clicking on the
header.
- Working rev.
- Indicates the version of the local file.
- Head rev.
- Indicates the most recent version of the file in the repository.
The VCS Explorer supports multiple selections. To select a single
line, simply left-click on it. To select a range of lines, select the
first line in the range, then hold down the Shift key and select the
last line in the range. To add or remove single columns from the
selection, hold down the Control key and left-click on the
columns that you want to select/unselect.
The explorer also provides an interactive search capability allowing you to
quickly look for a given file name. The default key to start an interactive
search is Ctrl-i. See Interactive Search for more details.
The VCS contextual menu can be brought up from the VCS explorer by
left-clicking on a selection or on a single line. See section 12.3 The Version Control Contextual Menu.
12.2 The VCS Menu
Basic VCS operations can be accessed through the VCS menu. Most of
these functions act on the current selection, i.e. on the selected items
in the VCS Explorer if it is present, or on the currently selected
file editor, or on the currently selected item in the Project/File
View. In most cases, the VCS contextual menu offers more control on
VCS operations. See section 12.3 The Version Control Contextual Menu.
- Explorer
- Open or raise the VCS Explorer. See section 12.1 The VCS Explorer.
- Update all projects
- Update the source files in the current project, and all imported
sub-projects, recursively.
- Query status for all projects
- Query the status of all files in the project and all imported sub-projects.
- Update
-
Update the currently selected item (file, directory or project).
- Commit
-
Submits the changes made to the file to the repository, and queries
the status for the file once the change is made.
It is possible to tell GPS to check the file before the actual commit
happens. This is done by specifying a File checker
in the
VCS
tab of the project properties dialog. This File
checker
is in fact a script or executable that takes an absolute file
name as argument, and displays any error message on the standard
output. The VCS commit operation will actually occur only if nothing
was written on the standard output.
It is also possible to check the change-log of a file before commit, by
specifying a Log checker
in the project properties dialog. This
works on change-log files in the same way as the File checker
works on
source files.
- Start Editing
-
Open the currently selected file for writing. On some VCS systems,
this is a necessary operation, and on other systems it is not.
- View revision history
-
Show the revision logs for all previous revisions of this file.
- Compare against head rev.
-
Show a visual comparison between the local file and the most recent
version of that file in the repository.
- Compare against working rev.
-
Show a visual comparison between the local file and the corresponding
version of that file in the repository.
- Compare working against head rev.
-
Show a visual comparison between the corresponding version of the
file in the repository and the most recent version of that file.
- Compare against revision...
-
Show a visual comparison between the local file and a specific revision
of that file in the repository.
- Annotate
-
Display the annotations for the file, i.e. the information for each
line of the file showing the revision corresponding to that file, and
additional information depending on the VCS system.
When using CVS, the annotations are clickable. Left-clicking on an
annotation line will query and display the changelog associated to the
specific revision for this line.
- Remove annotations
- Remove the annotations from the selected file.
- Edit revision log
- Edit the current revision log for the selected file.
- Add to repository
- Add a file to the repository.
- Remove from repository
- Remove a file from the repository.
12.3 The Version Control Contextual Menu
This section describes the version control contextual menu displayed when you
right-click on an entity (e.g. a file, a directory, a project) from various
parts of GPS, including the project explorer, the source editor and the VCS
Explorer.
Depending on the context, some of the items described in this section won't
be shown, which means that they are not relevant to the current context.
- Query status
- Query the status of the selected item. Brings up the VCS Explorer.
- Update
- Update the selected item. See Update.
- Commit via revision log
- This menu item is titled Commit when a revision log has already been
created.
See Commit.
- Start editing
- Open the selected file for editing. See Start Editing.
- View revision history
- View the revision history for the selected file. See View revision history.
- Compare against head rev.
-
Compare selected files. See Compare against head.
- Compare against working rev.
- Compare selected files. See Compare against working.
- Compare working against head rev.
- Compare selected files. See Compare working against head.
- Annotate
-
Enable annotations for the selected files.
See Annotate.
- Remove annotations
- Remove annotations for the selected files.
- Edit revision log
- Edit the revision log file corresponding to the selected files.
- Revert
- Revert the file to the latest version in the repository, erasing
your local changes.
- Remove revision log
- Deletes the revision log file corresponding to the selected files.
- Add to repository
- Add the selected items to the repository.
- Remove from repository
- Remove the selected items from the repository.
- Directory
- Only available when the current context contains directory information
- Query status for directory
- Query status for the files contained in the selected directory.
- Query status for directory recursively
- Query status for the files in the selected directory and all
subdirectories recursively, links not included.
- Update directory
- Update the files in the selected directory.
- Update directory recursively
- Update the files in the selected directory and all
subdirectories recursively, links not included..
- Project
- Only available when the current context contains project information
- List all files in project
- Brings up the VCS Explorer with all the source files contained in the project.
- Query status for project
- Queries the status for all the source files contained in the project.
- Update project
- Updates all the source files in the project.
- List all files in project and sub-projects
- Brings up the VCS Explorer with all the source files contained in the
project and all imported sub-projects.
- Query status for project and sub-projects
- Queries the status for all the source files contained in the project
and all imported sub-projects.
- Update project and sub-projects
- Updates all the source files in the project and all imported
sub-projects.
- Hide up-to-date files
-
Only available from the VCS Explorer.
Filter out up-to-date files, that is files that have not been modified locally
and that do not need to be updated.
- Hide non registered files
-
Only available from the VCS Explorer.
Filter out non registered files, that is files unknown to the version control
system, or whose information could not be retrieved (e.g. the version control
server is temporarily unavailable).
This document was generated
by Mail Server on November, 9 2003
using texi2html