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. It can also be used, with the
-s and
-t options, to inspect a stream for changes that occurred within a range of specified transactions; you might want to use the
-s and
-t options to monitor a stream that you use for builds, for example.
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.
update causes a new value to be recorded for the
update level workspace parameter.
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.
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:
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 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 updated. 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.
Override the optimized the search for modified files. When -O is used,
all files are considered, even those whose modification times have
not changed since the last time the workspace was updated or searched for modified files. Having to check all files, regardless of modification time, slows
update performance.