AccuRev® Command-Line Reference : update

update
incorporate other people's changes into your workspace
Usage
accurev update [ -r <reftree> ] [ -i ] [ -t <transaction-number> ]
[ -m ] [ -fx ] [ -O | -O2 ]
Description
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.)
Timestamps on Updated Files
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 Level and Scan Threshold
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.
A workspace’s update level is displayed by the show wspaces command:
> accurev show wspaces
...
gizmo_dvt_john C:/wks/gizmo/dvt_john moped 6 56 47 1 0
...
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.
Using ACCUREV_IGNORE_ELEMS During an Update
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:
Content (1 K) of "dir09\sub03\file00.txt" - failed
See also Pathname Optimization: ACCUREV_IGNORE_ELEMS and .acignore on page 21 in AccuRev Technical Notes.
Handling of (modified) Files / Merge on Update
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:
Some of the elements in your workspace are overlap/modified
and are not in your default group.
This default protects your data: a simple update would overwrite your changes to the file, which haven’t been preserved anywhere in the AccuRev repository.
You have several alternatives for handling this situation:
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:
AccuRev performs the automatic merge, replacing the file in your workspace with the merged version. This functionality parallels that of the CVS version-control system.
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.
Update and Replication
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.
3.
Data files representing new versions of elements are copied from the file storage area in the master repository to the file storage area in the replica repository.
4.
Data files are copied from the replica repository to your workspace tree. In addition to the files retrieved from the master repository in the preceding step, this can include files that have already been “downloaded” to the replica repository through other users’ commands.
5.
On both the replica server and the master server, the transaction level of the workspace is set to the most recent transaction (or to the transaction specified with update -t).
Updating Symbolic Links
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):
Re-linking "dir01sub03.mylink" - failed
Updating Reference Trees
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.
Implementing Partial Workspace Updates
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.
Options
-i
Show which files would be updated, but don’t perform the update.
-m
Enable the “merge on update” capability. See Handling of (modified) Files / Merge on Update above.
-r <reftree>
Specify a reference tree to be updated. (Default: update the current workspace.)
-t <transaction-number>
Update the workspace to the specified transaction. For example, if you specify
update -t 40 and the current transaction level is #45, versions from transactions #41 through #45 are not copied to the workspace.
Note that the transaction number you specify must be greater than the workspace update level. For example, if the current workspace update level is #40, you can specify a transaction number of #41 or more, up to the current transaction level in the depot.
You can see the current workspace update level in these places:
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.
-fx
Display the results in XML format.
-O
Override: don’t optimize the search for modified files. Note that having to check all files, regardless of modification time, slows command performance.
-O2
Use the local, client-based timestamp optimization methodology introduced in AccuRev 5.4.
Examples
List the files that would be copied into the workspace by an update command:
> accurev update -i
Copy recently created versions into a particular reference tree:
> accurev update -r /usr/alpha_test/gizmo4572
See Also
co, incl, keep, pop, purge
The Update Algorithm on page 38 of AccuRev Technical Notes
What’s the Difference between Populate and Update? on page 31 of AccuRev Technical Notes
Pathname Optimization: ACCUREV_IGNORE_ELEMS and .acignore on page 21 of AccuRev Technical Notes

AccuRev, Inc.
Phone: 781-861-8700
Fax: 781-861-8704
support@accurev.com