The ln command creates a new
element link or
symbolic link element, or changes the target of an existing link element. The link element’s status becomes
(kept)(member). As with other kinds of element, you must
promote a newly created or changed link in order to make it visible to other developers.
Although it can create a new element or change an existing one, the ln command does not cause a
pre-create-trig or
pre-keep-trig trigger to fire.
With the -i option, the
ln command lists all the link elements in the workspace that point, directly or indirectly, to the specified target element.
The add command can also create element link and symbolic link elements, by converting existing link objects.
An element link (or, more precisely, an “element-link element”) is an element whose content is a reference to another element. An element link is instantiated in a workspace tree or reference tree as a UNIX/Linux or Windows (on NTFS only) hard link.
A symbolic link (or, more precisely, a “symbolic-link element”) is an element whose content is a pathname. AccuRev does not check the validity of this pathname when the link is created or changed. Thus, any of the following might be true:
In general, an operating system command that processes a file’s contents (such as Windows type or
copy, or UNIX/Linux
cat or
cp) will traverse an element link or symbolic link to a file. That is, if you specify the link object to the command, it will process the target of the link. Similarly, the Windows command
dir and the UNIX/Linux command
ls will traverse an element link or symbolic link to a directory.
In general, an AccuRev command, such as
promote, processes a link object itself, not its target.
Both link-name and
direct-target-name are reported as
depot-relative pathnames. For a chain of links:
L -> I1 -> I2 -> ... -> T, each intermediate link (I1, I2, etc.) will be the
direct-target-name on one line and the
link-name on another line.
(for use with -s when the target is a depot-relative pathname) Converts the target pathname, which begins with
/./ or
\.\ , to a relative pathname.
When you’re creating a symbolic link (-s option), you can use any kind of pathname to specify the target: simple filename, relative pathname, depot-relative pathname, or absolute. The contents of the symbolic link element is the pathname, exactly as you entered it (with one exception — see below).
$ pwd
/user/wks/john/dir02/sub03
$
accurev ln -p -s /./dir00/sub00/file00.txt myslink
Created symbolic-link /./dir02/sub03/myslink->../../dir00/sub00/file00.txt
Note: Running "
accurev ln directoryName linkName" will create a UNIX / Linux symbolic link, even though AccuRev creates an
(elink).
Create an element link named relnotes, pointing to file
release_notes.txt, which resides two directory levels up:
> accurev ln -i \.\doc\release_notes.txt
\.\install\README.txt->\.\doc\release_notes.txt
\.\README.txt->\.\install\README.txt
add,
incl (to create cross-links between streams)