A cross-link is created in a workspace by the Include from Stream command (CLI:
incl –b). The command name implies that a connection is being established
from a specified backing stream
to the workspace. But an existing cross-link is listed by the CLI command
lsrules like this:
Each AccuRev stream (including snapshot streams and workspace streams) provides a namespace: a set of pathnames to some or all of the depot’s elements. For example:
Since this set of depot-relative pathnames defines a hierarchy, it’s often clearer to list the pathnames component-by-component, like this:
And suppose you’ve created a cross-link at subdirectory cmdshell, with workspace
W as the source stream and stream
S as the target stream. AccuRev will process the pathname, component-by-component, as illustrated here:
Note that in workspace W, you continue to access the cross-linked element, subdirectory
cmdshell, through its “local” name in the workspace’s namespace. It’s quite possible (but you don’t need to know) that this element has a different name — even a different pathname — in the target stream:
Pathname components below “cmdshell” are interpreted in the namespace of stream S, the target stream. For example, if script
end.csh has been renamed in stream
S to
topaz_exit.csh, then that’s the name you must use in workspace
W, as well:
The File Browser and the CLI commands stat and
files make this namespace-switching transparent: AccuRev shows you the element names and pathnames that will enable you to access the data from your current workspace or stream context.
You use the Include from Stream command to create a cross-link from your workspace to stream
topaz_mnt, at pathname
\.\tools\cmdshell. The immediate change to your workspace depends on its update level:
If you Update first, other backing-stream changes won’t be “mixed in” with the
Include from Stream changes during the next workspace update. Moreover, fully establishing the link from your workspace to the target stream will involve a single step (Include), rather than two steps (Include then Update).
In workspace W, the subdirectory will continue to have its “original” name,
cmdshell. But the subtree under the subdirectory will come from the stream
S2 namespace. By extension, you could chain any number of cross-links at the
cmdshell component:
W >
S1 >
S2 >
S3 >
S4 ... As above, the directory retains its “original” name in the workspace, and the workspace sees the directory’s subtree as it exists in the final target stream.
One consequence of AccuRev’s cross-link facility is that two (or more) different versions of the same element can appear at different pathnames in the same workspace or stream. We call this phenomenon double vision. This is not an error — at least, not from AccuRev’s perspective. Seeing the same element twice might be exactly what you intended, or it might signify that you’ve left some refactoring work unfinished.
You perform this work in your workspace, named topaz_refact. But when the dust settles, you find that the programs in the
tools subdirectory no longer work. You are not sure whether the problem is in the
tools directory or the
src directory. So you decide to “back out” your refactoring of the
tools directory, by cross-linking to the known-to-work version of the
tools directory in snapshot stream
topaz_2.3.9.
But your workspace now cross-links to the Release 2.3.9 version of the tools subdirectory, which contains the Release 2.3.9 version of the same element, at pathname
\.\tools\tools.readme:
This case of double-vision is clearly an error, reflecting the fact that your refactoring work is still ongoing. In other cases, you might want two (or more) versions of a commonly used source file, say topaz.h, to appear in a workspace. Perhaps several different versions of the file are required, in order to build different executables using that file. Version skew is the executables’ other dependencies might mandate the different versions of
topaz.h.
The accurev name command lists the pathname for a given element (specified by element-ID) in your workspace. It can also list the pathname for a specific version of an element, or the version in a specific stream:
In a double vision situation, the name command can list all of an element’s pathnames in a workspace or stream:
Section Multiple Cross-Links: Chaining describes how a set of cross-links can define a “chain” of backing streams to be used at different components in a pathname:
In this case, the second link in the cross-link chain (S1 > S2) occurs at a
higher pathname component,
DDD, than the first link (
W > S1, at component
GGG). AccuRev recognizes this situation as a
cross-link overlap.