The anc command determines one of the following:In its simplest form (no command-line options), anc reports the direct ancestor of the version in your workspace for the specified element.Some forms of this command process “the version in your workspace”. This means the version currently in the workspace stream. anc always ignores the file, if any, in the workspace tree. Thus, the “anc” of a modified file element is not the version that you started editing.With no options, anc determines the predecessor of the version in your workspace. With just the -v option, it determines the predecessor of the specified version. The algorithm it uses in both these cases is:The -1 option (“dash-one”, meaning “the previous one”) uses a different algorithm, which finds the “previous occupant” of a workspace or stream. (This algorithm is also used by the diff -1 command.) The -1 option finds the version that was in a workspace or stream just before the specified version was created there:
1. Consider the version specified with -v (default: the version in your workspace stream).
2. Determine the stream, S, to which this version belongs. Unlike with the predecessor algorithm, no virtual-version to real-version mapping takes place in this step. With the command anc -v eagle_dvt/4 -1, the stream is set to eagle_dvt.For a real version in a workspace stream, this option yields the same result as the “predecessor algorithm” described above. That is, adding this option doesn’t change the command’s result. But specifying -1 does change the result for a version created in a workspace stream by a co or anchor command; these commands create a virtual version in a workspace stream, not a real version.Instead of determining the direct ancestor of the specified version, determine the corresponding basis version. See the patch reference page for more information on the basis version.The command anc -v rose_dvt_john/6 -j finds the basis version corresponding to version rose_dvt_john/6 of an element.The command anc -v rose_dvt_john/6 -J considers two versions of the element: (#1) that same basis version and (#2) the common ancestor of version rose_dvt_john/6 and the version in your workspace.If version #2 is a direct descendant of version #1, then anc reports version #2 as the result. This occurs when a merge was performed to your workspace from one of the versions between the basis version and version rose_dvt_john/6.If version #2 is not a direct descendant of version #1, then anc reports version #1 as the result. In this case, -J produces the same result as -j.(“dash-one”) Determine the version that was in the workspace or stream just before the specified version was created. The result is reported as a real version, even if you are “looking backward” in a dynamic stream. See Previous Occupant Algorithm above.Note: this option is designed to be used with -v. Be sure to specify a complete version-ID — for example, -v rose_dvt/14, not -v rose_dvt.The version whose ancestor is to be determined. If you omit this option, anc uses the version in the workspace stream. If you specify the version using numbers for both stream and version (16/1, for example) while not in a workspace, you must also specify a depot using -p.Determine the common ancestor of the current version of element brass.h and version tulip_dvt_mary\3:Determine the common ancestor of the current version of element brass.h and version 33\3 in depot cctulip:Determine the version of brass.h that was in stream eagle_dvt just before version eagle_dvt/4 was created by promote:Real Versions and Virtual Versions of the AccuRev Concepts Manual
Micro Focus |