3.3 Cloning and Promoting

If you don't need to track and merge upstream changes from a parent branch, you can create a new package and copy the contents of the original package to start your development branch. You have two ways to do this:

From that point on, the clone behaves as if you created it, so build and maintain it in the same way as your other packages. You will not be able to use the cvc merge operation on your clone.

Cloning creates a sibling relationship between the original package and the clone. In other words, if the original package is a shadow, the clone with share the package's parent branch. For a detailed explanation of this relationship, see the "Branching with Shadows and Clones" section in Conary Versions and Flavors, available at docs.rpath.com/conary.

If you're using rBuild, you can promote your packages and groups through stages with the rbuild promote command. Conary also includes the command cvc promote for use outside of the rBuild structure. This cvc promote lets you to clone a group from one label to another, prompting Conary to also recurse the group and clone all the packages and components also included in that group.

The fromLocation and toLocation values used in the cvc promote command can be full branches, labels, branch names (begining with "@"), or namespaces (beginning with ":"). Some variations are:

$> cvc promote group-example example.rpath.org@corp:1-test--example.rpath.org@corp:1
$> cvc promote group-example @corp:1-test--@corp:1
$> cvc promote group-example :1-test--:1

Conary completes the missing parts of a label as follows:

Use the following command to show the installLabelPath entry that applies in the scope of your current working directory:

$> conary config | grep installLabelPath

When you abbreviate the labels used in the command, Conary will return an error if the promoted item is not found on any of the labels in the installLabelPath that applies to the scope of your current working directory. In such cases, use the complete label to override the auto-completion by Conary.

Limitations for cloning and promoting

Promote and clone have a limitation with respect to the parent-child and sibling relationships revealed in a the full version string for the component, package, or group you're cloning. Developers can clone between siblings, such as:

  • /branchA to /branchB

  • /parentZ//branchA to /parentZ//branchB

They can also clone upstream to parents, such as:

  • /parentZ//branchB to /parentZ

...and upstream to siblings of parents, such as:

  • /parentZ//parentY//branchC to /parentZ//parentX

  • /parentZ//parentY//branchC to /parentZ

However, developers cannot clone between shadow branches that do not share a parent, such as /parentZ//branchA to /parentW//branchB).