The update command copies versions from your workspace’s backing stream into your workspace. This has the effect of incorporating other people's changes, which they have promoted to the backing stream, into your workspace.
update replaces only those files in your workspace that are
stale. (Use
update -i to list stale files.) It does not replace files that you have modified, whether you have saved them with
keep or not. (But
update can attempt to perform merges on some modified files — see
Handling of (modified) Files / Merge on Update below.)
By default, each file copied into your workspace by this command has its timestamp set to the current time. If environment variable
ACCUREV_USE_MOD_TIME is set, the timestamp is set to the time the version was originally created. (Note: that’s the time the version was created in some user’s workspace stream, not the time it was subsequently promoted to the backing stream.) Setting this environment variable may defeat an optimization in the
stat command. See
Optimized Search for Modified Files: the Scan Threshold on page 240.
update causes new values to be recorded for two workspace parameters, the
update level and the
scan threshold.
When an update command completes, the workspace is fully up-to-date. That is, your workspace has incorporated changes that were recorded in the depot as transactions, up to and including the most recent transaction, say #4167. In this case, transaction #4167 is said to be the
update level of your workspace. Subsequent changes, made by you and by other users, might cause the depot’s most recent transaction to increase to #4328, but your workspace’s update level remains at #4167 until you perform another
update.
In this example, the workspace’s update level is transaction #47. (The “target level” is transaction #56, indicating that the most recent update of this workspace was interrupted before it could be completed.)
AccuRev also notes the time that the update command began execution, and records this as the workspace’s
scan threshold. The update level and scan threshold are
not equivalent. For example, suppose you perform an
update just before a 3-day weekend, during which no AccuRev commands are executed. If you perform another
update when you return to work, the update level remains the same (there were no new transactions in the depot), but the scan threshold is advanced from before-the-weekend to after-the-weekend.
Why would you perform an update when there’s been no AccuRev activity? Certain AccuRev commands, including
stat and
update itself, use a performance optimization based on the scan threshold. In general, the more recent the scan threshold, the better these commands perform. For more information, see
Optimized Search for Modified Files: the Scan Threshold and
Improving ‘stat’ Performance in the
stat reference page.
Note: AccuRev 5.4 introduced a second, optional timestamp optimization methodology that does not depend on the scan threshold described above. See the “Local, Client-Based Timestamp Optimization” section of the AccuRev
On-Line Help Guide for details.
In addition to the timestamp optimization described in the preceding section, AccuRev can use a pathname optimization during execution of an
update command. The
ACCUREV_IGNORE_ELEMS environment variable, if set, always affects the
stat and
add commands. If you set environment variable
USE_IGNORE_ELEMS_OPTIMIZATION to
TRUE (the value is case-insensitive), then
ACCUREV_IGNORE_ELEMS affects the
update command, too.
CAUTION: Make sure that the
ACCUREV_IGNORE_ELEMS value matches pathnames of external objects only. If the pathname of a file element is matched during an update, and that element has
(modified) status, AccuRev will proceed with the update, invoking the routine that overwrites the file with the backing-stream version. This routine will get an error when performing a CRC check on the file, producing a message like this:
If you have changed a file in your workspace that is due to be updated, and the file is not yet a member of the workspace’s default group, the file has
(modified)(overlap) status. If there are one or more such files in your workspace, AccuRev’s default is to cancel the
update command:
•
|
anchor or keep those files, then update the workspace. The file(s) that you’ve processed with anchor or keep won’t be updated.
|
•
|
purge those files, then update the workspace. The file(s) that you’ve processed with purge will be updated.
|
•
|
As of AccuRev 4.6, you can use the -m (“merge automatically”) option. An update -m command succeeds only if each file with (modified)(overlap) status can be merged automatically — that is, non-interactively — with the backing-stream version. If this condition is satisfied, the update proceeds and each such file is handled as follows:
|
•
|
No keep or merge is recorded in the AccuRev database.
|
If you have changed a file in your workspace that is not due to be updated, and the file is not yet a member of the workspace’s default group, the file has
(modified) status — but not
(overlap) or
(member). In this case,
update simply bypasses that file (whether or not you use
-m). After the update finishes, all such files retain their
(modified) status in the workspace.
The update operation works as follows when you execute it on a client that uses a replica server:
1.
|
An implicit replica sync command is performed, copying database transactions from the master repository to the replica repository. This brings the replica database completely up to date.
|
2.
|
A stat operation is performed on the replica server, to determine the state of the workspace stream and its backing stream.
|
On Windows systems, a symbolic link to a directory is implemented as a junction point at the file system level. Accordingly, such links are not supported for FAT/FAT32 file systems. When updating a workspace located in a non-supported file system, an existing symbolic link to a directory generates an error (and
update creates an empty, standard directory at the link location):
Use update -r to update a reference tree. To keep a reference tree as up-to-date as possible, call
update from a job-scheduling program, such as
cron (UNIX/Linux) or
at (Windows). You can also use AccuRev's
server-post-promote-trig trigger to update reference trees automatically. See
Using a Trigger to Maintain a Reference Tree on page 43 in
AccuRev Technical Notes.
update always processes all the elements in a workspace; there is no option to specify a subset of elements to be update. You can accomplish this, however, using a series of
merge commands. See
Using Merges to Implement a Partial Update of Your Workspace in the
merge reference page.
•
|
In the Java GUI - Select View > Workspaces from the main menu. In the Workspaces tab, select Show Details (in the tab’s lower right corner). The current update level for all workspaces in the depot is displayed in the Update Level column.
|