The Version Browser displays some or all of an element's versions, using color-coded lines to indicate the way in which each version was created. You can perform various version-related operations, such as comparing any two versions (text files only) and copying any version to your workspace.
Accessing the Version Browser
You can access the Version Browser by right-clicking an element in the File Browser and choosing the Version Browser from the context menu. You can also click the Version Browser button ().
The Version Browser opens in a new tab.
Version Browser Display
This section describes the display features of the Version Browser and what you can do to change the display.
Transaction Time Line
The transaction time line appears at the top of the Version Browser. Transactions are listed in chronological order (oldest to most recent); information about each transaction includes a timestamp, transaction number, and AccuRev username.
The Version Browser uses these layout rules to convey information about a version’s relationship with streams and transactions:
- Versions belonging to a particular stream are shown horizontally aligned with that stream.
- Versions belonging to a particular transaction are shown vertically aligned with that transaction on the timeline.
You cannot change the layout manually (by dragging and dropping a version, for example). Layout can change, however, when you expand a version. See Expanding Versions for more information.
The Version Browser uses colors to convey information about a version’s history and ancestry:
- Versions are usually outlined by a thin black line; the version outlined by a thicker blue line is the most chronologically recent version with a real ancestor.
- Versions are connected by lines. The colors of these lines indicate something about the versions’ ancestry. See Ancestry Relationships for more information.
The version on the left is a direct (real) ancestor of the version on the right.
The version to the right is a virtual version. If a black line connects to the version on the left, that version is the real ancestor of the virtual version.
The version to the left has undergone a merge operation to become the version on the right.
The version to the left has undergone a patch operation to become the version on the right.
The version to the left has undergone a revert operation to become the version on the right.
Changing Display Content
This section describes some of the ways you can change the content of the Version Browser.
The left side of the Version Browser toolbar contains controls that let you filter the display:
- The transactions drop-down list () lets you specify the maximum number of transactions to display at a time. You can choose numeric values (10, 20, and so on) or you can choose a time period (all transactions within a day or a week, for example).
- The date buttons (for example, ) to the right of the transactions drop-down list let you specify a time period to filter the display to include only transactions occurring during that time period. Using this option causes the filter to change to Custom.
Note: By default, the dates displayed in the date buttons correspond to the date of the first and last transactions (respectively) displayed in the Version Browser.
Versions that contain merge, patch, or revert information can be expanded to display versions related to those operations. Merged, patched, or reverted versions include a symbol in addition to the version number, as shown here:
Symbols differ based on the type.
To expand a merged, patched, or reverted version, right-click it and choose Expand Ancestry from the context menu.
You can add and remove streams from the Version Browser display.
- Use Add Stream to show additional versions of this element from the stream you select. Streams added to the Version Browser will not persist after using the Refresh command.
- Use Remove Stream to remove previously-added streams. Workspace streams cannot be removed in this manner.
Other Version Browser Toolbar Items
The right side of the Version Browser toolbar contains:
- The path and file name of the element in the AccuRev repository.
- Tools used to mail or create a Web UI URL you can use to share the element’s version information with other AccuRev users. See Obtaining Web UI Links for more information.
- Buttons used to toggle between the History Browser and the Version Browser.
Version Browser Commands
The following commands are available in the Version Browser. Commands are available in both the toolbar and context menu unless noted otherwise.
Using the Open Commands the selected version. This command is also executed when you double-click a version.
Invokes your Web browser's Open command, allowing you to open or save (see Save As) the selected file version.
Opens the selected version in the Annotate tool. See Reviewing Changes to Text Files.
Diff Against Other
Compares two versions shown in the Version Browser using the Diffing Files in AccuRev.
Expands the selected version if it contains merge, patch, or revert information. These Version Browser nodes contain a merge icon as well as the version number, for example . This command is available from the context menu only.
Displays the Element Properties dialog box for the selected version. See Displaying Element Properties.
Show additional versions of the element from the stream you select. This command is available from the Version Browser toolbar only.
Note: Streams added to the Version Browser do not persist after using the Refresh command.
Removes a non-workspace stream previously added to the Version Browser using the Add Stream button. Workspace streams cannot be removed in this manner.
Send to Issue
Record the selected versions in the change package section (Changes tab) of an issue record. You are prompted to enter the issue number. This command (Send To > Issue) is available from the context menu only.
See Using AccuWork for more information about issues and change packages.
Send to Issue (specifying basis)
Similar to Send to Issue, except that it allows you to pick the basis version, rather than AccuRev determining it automatically. This command (Send To > Issue (specifying basis)) is available from the context menu only.
See Using AccuWork for more information about issues and change packages.
This section describes the types of ancestry relationships displayed in the Version Browser.
Versions Created by Modifying an Existing Version – Direct Ancestors
One of the most common AccuRev operation is making changes to an existing version and then using the Keep command to save the changes in a new version. The version in your workspace created by the Keep command is called a real version, because it represents a change to the element. Other commands (Rename, Defunct, and Undefunct, for example) can create real versions in your workspace, too.
The Version Browser uses a solid black line to connect the existing version (called the direct ancestor or predecessor) with the new version.
Exception: Versions created by merge, patch, and revert operations are connected using other colors. See Versions Created by Merge, Patch, and Revert for more information.
Versions Created by Promoting an Existing Version –Virtual Versions
Workspaces contain real versions, which represent changes to elements. By contrast, all versions in dynamic streams are virtual versions, created with the Promote command. Each virtual version is an alias (pointer) to some real version in a user's workspace. The Version Browser uses a solid green line to connect a virtual version in a dynamic stream to the corresponding real version in a workspace.
Exception: The Anchor and Send to Workspace commands create a virtual version in a workspace. These commands, available only in the Java GUI and command line interface (CLI), do not represent a change to the element, merely the restoration of an existing version to the workspace.
In a depot with a deep stream hierarchy, it is common to successively promote a particular version to the parent stream, then to the grandparent stream, then to the great-grandparent stream, and so on. All the versions created by this series of Promote commands are aliases for the same real version. The Version Browser shows how all the virtual versions are related to the original real version.
Versions Created by Merge, Patch, and Revert
Note that the Merge and Patch commands are available only in the standalone Java GUI and CLI.
Merge – Merging Two Versions into a New Real Version
A standard merge operation combines the contents of two versions of a file:
- The most recently kept version in your workspace stream. This version contains the changes that you have made to the file in your workspace.
- The most recent version in the backing stream. This is the last version that was promoted.
The result file of the merge operation is kept as a new version in the workspace stream. (You can think of merging as a type of text-editing operation; as with any edit to a file, you preserve the results with Keep.) This new, merged version has two ancestors: the two versions listed above.
The Version Browser uses a solid red line to connect the existing version (called the direct ancestor or predecessor) with the new version.
AccuRev always records real versions, not virtual versions, as the two ancestors of a new, merged version.
Patch – Selective Inclusion of Another Version's Changes
A patch operation is similar to a merge operation. In both, text from another version is incorporated into your workspace's version.
- A merge operation considers the entire contents of the "from" version.
- A patch operation considers only some of the changes in the "from" version. Typically, these are recent changes made by one user, recorded in one version or a set of consecutive versions.
The Version Browser uses a solid orange line to connect the existing version (called the direct ancestor or predecessor) with the new version.
Revert – Selective Removal of Changes to a Version
A revert operation is the opposite of a patch operation. It is sometimes referred to as a 'reverse patch' operation. Whereas a patch adds a selected set of changes, a revert removes a selected set of changes. A version created by the Revert command has two ancestry lines:
- A solid blue line indicates the version from which Revert removed some changes.
- A solid black line indicates the basis version of the removed patch or change package entry.
Closest Common Ancestor
Blue, black, orange, and red lines trace the ancestry of real versions of an element. You can use the real-version ancestry to determine the closest common ancestor of any two versions. The closest common ancestor is the most recent version upon which the two versions are both based, by some combination of direct ancestor and merge connections. (When considering a virtual version in a closest-common-ancestor analysis, first follow the green line back to the corresponding real version.)
Note: Depending on the version whose closest common ancestor you are trying to find, you might need to add one or more streams to the Version Browser display. See Adding and Removing Streams for more information.
You can also use the CLI command accurev anc -c to find the closest common ancestor of two versions.
In the Merge command, AccuRev determines the closest common ancestor of the two versions to be merged, and uses this version to perform a three-way merge. AccuRev tracks patch ancestry separately from merge ancestry. In determining the closest common ancestor of two versions for a merge operation, AccuRev takes into account previous merge operations, but not previous patch or revert operations.