The essential difference between Populate and
Update concerns time. Roughly speaking, your workspace contains an informal “baseline” (the contents of the shared backing stream, at a particular moment) plus “changes” (the modifications that you make to some of the files). The
Update command advances the workspace’s baseline from the time of the workspace’s last update to the present moment. This incorporates into the workspace data recently placed in the backing stream by other team members.
Note: AccuRev actually tracks the workspace’s baseline in terms of transactions, not timestamps.
The Populate command doesn’t advance a workspace’s baseline at all, but leaves it “stuck in the past”. Instead,
Populate simply restores the appropriate “old” version of one or more elements that are currently missing from the workspace.
The two commands also differ in their scope: Update always processes the entire workspace;
Populate processes just a selected set of elements or directory subtrees.
The Update command changes both the
workspace stream and the
workspace tree:
By contrast, the Populate command changes the workspace tree only, not the workspace stream. In particular, it doesn’t change the workspace stream’s update level.
Populate merely fixes a discrepancy between the workspace stream and the workspace tree: a certain version of a file is in the workspace stream, but there is no actual file in the workspace tree — that is, the file’s status is
(missing). To fix this situation, you invoke
Populate, which copies the version currently in the workspace stream to the workspace tree.
Note: It would be incorrect to conclude that
Update never processes
(missing) elements, and that
Populate only processes
(missing) elements. Examples 3 and 4 below show that exceptions exist for both these “rules”.
You’ve just finished a coding project, so you’re not actively working on any files in your workspace. Other team members create new versions of files red,
white, and
blue in their workspaces, then promote those versions to the team’s backing stream. You invoke the
Update command, which copies the most recent versions of
red,
white, and
blue from the backing stream to your workspace.
Since you have complete control over the files in the workspace tree, it’s easy to accidentally delete a version-controlled file with an operating-system command or a third-party tool. If you do this, AccuRev knows that the file should be there, because a version of the element still exists in the workspace stream. Thus, the File Browser continues to list the element, but shows it as
(missing) from the workspace tree. You select the element and invoke
Populate to fix the accidental deletion.
Update and
Populate differ in how they handle elements that are
active (are in the workspace’s default group). The
Update story is simple: it
never overwrites the file in the workspace tree.
Populate usually doesn’t overwrite the file, but there are a couple of cases to consider.
•
|
It doesn’t need to overwrite a file that you’ve kept and not subsequently edited, because the active version in the workspace stream is identical to the file in the workspace tree.
|
Be careful — (modified) files will also be overwritten if you invoke
Populate with both the
Recursive and
Overwrite options on a directory that directly or indirectly contains the active element.
Let’s see how Update and
Populate differ in this situation:
If you select both blue and
green in the File Browser, then invoke
Populate, the two files that you deleted are restored to the workspace tree. This does
not bring in the new backing-stream version of
blue, because that version is not in the workspace stream — it’s too new, having been created after your workspace’s most recent update.
If you invoke Update instead of
Populate, the workspace tree gets the new version of
blue. No version of
green is copied to the workspace tree, because
Update only handles new versions — ones that enter your workspace stream as a result of advancing its update level.