posted by Carlos Leonhard Woelz on Fri 20th Feb 2004 07:29 UTC

"Learning CVS, Page 4/7"

To update the working folder to a branch.

- Click the "File" menu then the "Open Sandbox..." menu item.
- Select the desired working folder / module in the file dialog.
- Click the "Advanced" menu then the "Update to Tag/Date..." menu item.
- The "CVS Update Dialog" will pop up.
- Press the "Fetch List" button under the "Update to Branch".
- Select the correct branch in the "Update to Branch" dropdown combo box.
- Press OK.

Alternatively, you can update the working directory to any date (useful for tracking problems), or tag. Tags are marks for a specific version of the repository, like a release. So if you want to get the exact same code of a release, you can do so by updating to that release tag.

Update Output and File Status

Using either the cvs command or Cervisia, while you update the working folder, you will see messages from CVS telling you what it is doing, and giving updated information on the status of each file. In Cervisia, you can see the cvs command output (for all actions, not only for update) in the lower of the main window.

P: libmedia.cpp
U: process.h
C: same_dialog.ui
A: new_dialog.ui
R: old_dialog.ui

The meaning of the first letter in these lines is:

- "P" means that CVS has "patched" the file with a newer version, or in other words, downloaded only the differences between the two files, and applied it to make the two versions identical. "U" means essentially the same thing, except that CVS decided it would be more efficient to bring the file "update-to-date" by downloading the entire file rather than patching. This happens for all new files added from the repository to your working folder.
- "M" means you have a modified version of the file in your working folder. This happens for all the files you modify: CVS respectsyour modifications and does not try to undo them. CVS will add to the files in your working folder modifications from other developers if they apparentlydon't conflict with each other.
- "C" means there are conflicts in a file you modified: while you where working on the file, another developer committed some changes that affect the same lines you were working with. You will have edit the file and merge the modifications in a meaningful way. To avoid any loss of information, CVS saves an unmodified version of the file with the format ".#name_of_the_file . number_of_the_version_you_modified". Example: if you modified the file same_dialog.ui version 1.5, the backup file will be named ".#same_dialog.ui.1.5"..
- "?" means there is a file in your working folder, that is not in the CVS repository and that is not in the list of files to be ignored. CVS leaves these files alone, but warns you that they are not categorized neither as part of the repository or as files to ignore.
- "A" means you explicitely told CVS to add the file to the list of files you think are part of the project, but you did not commit yet to upload it to the main repository. "R" means you told CVS to remove the file from the repository, but did not commit to perform this action. We will see more about this in the Adding, Removing and Committing section. These actions are only meaningful when you have your own CVS account, and therefore can commit.

Using the cvs update command output, it is difficult to quickly visualize the status of the files. Cervisia displays this information in a friendlier way: integrating the status of the files with the main window. Cervisia checks the status of the files automatically after each update, but you also can use the "Status" menu item under the "File Menu" or you can press "F5" to know the status of the files without updating the working folder.

The files can be classified in the following states, regarding the differences between the working folder and the repository.

- Up to date: The files are the same.
- Locally Modified: The version in your working directory is different from the repository because you modified it.
- Locally Added: You have explicitely told CVS that the file is part of the project, but did not commit it yet to the repository.
- Locally Removed: You have explicitely told CVS that the file is not part of the project anymore, but did not commit it yet to the repository.
- Needs Update and Need Patch: There is a newer version of the file in the repository.
- Conflict: You made modifications to the file but did not commit and another developer committed changes to the same files. An update won't be sufficient to merge the files, as the changes conflict. You will have to edit the file to solve the conflict before committing your changes.

Table of contents
  1. "Learning CVS, Page 1/7"
  2. "Learning CVS, Page 2/7"
  3. "Learning CVS, Page 3/7"
  4. "Learning CVS, Page 4/7"
  5. "Learning CVS, Page 5/7"
  6. "Learning CVS, Page 6/7"
  7. "Learning CVS, Page 7/7"
e p (0)    25 Comment(s)

Technology White Papers

See More