• Edit Stage. Two or more users start with the same data: a particular version of a file. Each user works on a copy of the file in his own workspace. He can keep as many (private, intermediate) versions as he wishes in his workspace stream.
• Merge Stage. The merge stage begins when one of the developers promotes his private version of the file to the backing stream. After that, each other developer must merge the current version in the backing stream into his own work, then promote this merged, private version. In the end, all users’ changes are incorporated into the backing stream; conflicting changes to the file, if any, are both detected and resolved.If two developers work on a file concurrently, a single merge-and-promote operation is required. If N developers work on a file concurrently, then N–1 merge-and-promotes are required.Accordingly, AccuRev supports serial development through its exclusive file locking feature. Each workspace is in parallel-development mode (exclusive file locking disabled) or is in serial-development mode (exclusive file locking enabled). You can also set locks on individual elements.
1. A user starts working on a file by specifying it in a co (“checkout”) or anchor command. The file changes from being read-only to writable.
2. AccuRev places an exclusive lock on the file. This prevents the file from being processed with co, anchor, or keep in other workspaces.
3. The user can edit and keep any number of private versions of the file in his workspace. Then, the user promotes his most recently kept version to the backing stream. The exclusive file lock guarantees that no merge will be required before this promotion.
4. After promote records the new version in the backing stream, things return to the initial state: AccuRev releases the exclusive lock, and the file returns to read-only status in the user’s workspace.
5. A user in any workspace can now co or anchor the file, which starts the exclusive-file-locking cycle again.Exclusive file locking does not prevent any user from modifying any file with a text editor or IDE. AccuRev encourages users in serial-development-mode workspaces to “ask permission first”: it maintains files in a read-only state, and makes a file writable when a user executes a co or anchor command on it. But users can modify a file “without asking permission”, by changing the access mode (UNIX/Linux: chmod command, Windows: attrib command or Properties window) and then editing it. Such “unauthorized” changes can’t be sent to the AccuRev depot, though: the exclusive file lock disallows a co, anchor, or keep.AccuRev also offers a less-restrictive variant of exclusive file locking. Anchor-required workspaces allow parallel development, with multiple users modifying the same file at the same time (in their own workspaces). But as in the exclusive file locking environment, files are read-only by default, and must be anchored (“checked out”) before they can be modified.
Micro Focus |