Updating a Workspace

The workspace’s two-part structure — workspace tree on the client side, workspace stream on the server side — plays an important role in how AccuRev keeps a workspace synchronized with the stream it is based on. (Refer to How Changes Migrate Through the Stream Hierarchy for information on how the streams synchronize with each other.)

At any given time, a workspace should contain:

  • The files you’re actively working on (that is, the members of the workspace’s default group)
  • Copies of the backing stream’s version for all other files

(You can think of the active files as being in the “foreground” of the workspace, and the non-active files as being in the “background”. Those “background files” are copies of versions in the stream to which the workspace is attached.

A workspace often gets out-of-date with respect to its backing stream. Typically, each member of a development team has his own workspace, and all the workspaces are based on the same backing stream. For files that you’re not working on, your workspace continues to have versions from the time the workspace was last synchronized with the backing stream, even as your colleagues are promoting new versions of those files. If the backing stream contains a file more recent than one in your workspace, that file’s status in your workspace is stale.

It’s the job of the update command to synchronize the workspace and its backing stream in this way. To determine which files you’re actively working on, update looks in the workspace stream; it considers a file to be active if you’ve created one or more new versions of it in the workspace stream. Then, update makes sure that the workspace tree contains a copy of the backing-stream version of each non-active file. Typically, this involves replacing old files with new files. But it can also involve renaming, relocating, and removing files.