Use Xlinks

You can use Xlinks to share components between different repositories. For more information about what Xlinks are and how you can use them, refer to Xlinks.

You can create Xlinks in the UVCS desktop application.

Note: You can only create partial Xlinks through the command line.

  1. In the Workspace Explorer, right-click the directory or existing Xlink that you want to create an Xlink inside of.
  2. Select Create Xlink.
  3. In the dialog that opens, select the target changeset:
    1. Select the target UVCS server.
    2. Select a repository inside the server.
    3. Select a changeset inside the repository.

You can also optionally set the writable and relative server options for the Xlink:

  • Writable: allows you write permissions in the Xlinked repository.
  • Relative server: the Xlink gets the local version of the repository (recommended when you use replicated repositories).

If you create a writable Xlink, you can set the expansion rules.

To modify an Xlink, right-click on the Xlink and select Edit Xlink. In the Edit Xlink dialog, you can edit the target changeset of the Xlink. If you have a writable Xlink, you can edit the expansion rules.

To create an Xlink, you need to use the cm xlink command. For more information, you can refer to the xlink CLI reference, or use the cm help xlink command.

For example, you can create the following Xlink:

cm xlink component1 / 1@mylibrary
ParameterDescription
component1The directory in the project repository that points to the mounted mylibrary component. This directory must not already exist in the repository. The xlink command creates an item for the directory, and throws an error if a file of the directory already exists with the same name.
/The directory in the target repository.
1The changeset number in the target repository.
mylibraryThe target repository. Together with the changeset, this forms a changeset specification. In this case, there is no server specified. If you do specify a server, the spec looks like the following: 1@mylibrary@servername:8087.

Note: You can also specify a label instead of a changeset. Since a label is a pointer to a changeset, the two specifications are interchangeable. If you specify an xlink with a label, the xlink only uses the label to retrieve the changeset and sets the xlink to it. This means that if you move the label, the xlink still points to the original changeset.

Use a partial Xlink to mount a subdirectory in your repository. A partial Xlink has to be read only. For example:

cm xlink component1Src /src/dll cs:478@mylibrary

In the above example, the Xlink ensures that any files in cs:478@mylibrary that exist in the subdirectory /src/dll appear as read only files under the /component1Src directory in the current workspace.

To create a writable Xlink, you need to specify the -w modifier, for example:

cm xlink -w component1 / 1@mylibrary

To modify an existing Xlink, you can use the -e modifier. For example, you can modify an existing Xlink component1 to point to changeset 5 on repository mylibrary:

cm xlink -e component1 / 5@mylibrary

For more information about how to modify an Xlink in the command line, refer to the xlink CLI reference, or use the cm help xlink command.