vbranch(1)

Name

vbranch - Create a new branch of a package in the Vesta repository

Synopsis

vbranch [-q] [-Q] [-m] [-M] [-f] [-o old-version | -O] [-h hints] [-R repos] [package/]branch

In the most common usage, only the package/branch argument is given, to specify the new branch's name.

Contents

Description

See the vesta-intro man page's Terminology section for definitions of terms, and its hoName Interpretation section for an explanation of how names are looked up.

The vbranch command creates a branch of a package in the Vesta repository. A branch is a new package that is (usually) placed as a subdirectory of the parent package, with a name based on one of the versions of the parent package (the branch base), and with a version 0 that is identical to the branch base.

For example, if common/cxx/2 is an existing package version, "vbranch common/cxx/2.bugfix" will create a new package named common/cxx/2.bugfix, with version common/cxx/2.bugfix/0 being identical to the branch base common/cxx/2.

vbranch figure

In more detail, vbranch:

If the name package is unqualified (does not have "/", ".", or ".." as its first arc), it is interpreted relative to the site's default directory of packages, DefaultPackageParent. If package is omitted (that is, if the argument to vbranch does not contain a "/"), it defaults to ".". If the name old-version is unqualified, it is interpreted relative to package.

You must have write access to package. The newly created branch is owned by you, but has access permissions inherited from package.

In the presence of replication, branch creation cannot always be carried out entirely in the local repository. In particular, the local repository may contain no replica of one of the needed objects, or it may contain a non-master replica where the master replica is needed. Also, the -m/-M flags control which repository vbranch will give mastership of the created branch. (See vrepl(1) and vmaster(1) for more information about replication and mastership.) The exact steps are slightly different depending on which repository has the master copy of package and whether the local repository is to have the master copy of the created branch (controlled by the -m/-M flags).

If package is mastered locally, vbranch creates the branch in the local repository (and the -m/-M flags have no effect). However, if old-version does not exist locally, vbranch searches for a copy and replicates it to the local repository before creating the branch.

If package is not mastered locally, vbranch may give mastership of branch to the local repository, if either the -m flag is specified or [UserInterface]vbranch_acquires is set to true. If old-version does not exist locally, vbranch searches for a copy and replicates it to the local repository. vbranch then creates the branch remotely in the master copy of package (except for inserting old-version), replicates it to the local repository, transfers mastership, and finally inserts old-version.

If the -M flag is specified or [UserInterface]vbranch_acquires is set to false and package is mastered remotely, vbranch will leave mastership of branch with the master repository of package. In this case, if old-version does not exist in the remote master repository, vbranch searches for a copy and replicates it to that repository. vbranch then creates the branch remotely in the master copy of package (including inserting old-version), and replicates it to the local repository.

vbranch returns status 0 for success, 1 for parameter syntax errors, or 2 for more serious errors.

Flags

-q
Quiet; suppress printing out what is being done.
-Q
Query; print out what the command would do, but don't do it.
-o old-version
The branch base: the version in the parent package from which the new package branches off. Defaults to the initial substring of branch that consists only of decimal digits; if this substring is empty, -o or -O must be specified explicitly.
-O
Omits binding branch/0 and setting the old-version attribute.
-h hints
If vbranch fails to find the master copy of a directory it needs to modify (or fails to find any copy of the old version), you can suggest additional repositories for it to look in using this option. The hints argument is a comma- or space-separated list of repositories, specified by host name and TCP port number in the format host:port. The :port portion may be omitted; it defaults to [Repository]VestaSourceSRPC_port.
-R repos
Create the branch in repos instead of the default local repository. The repository is specified by host name and TCP port number in the format host:port. The :port portion may be omitted; it defaults to [Repository]VestaSourceSRPC_port.
-m or -M
Do (-m) or do not (-M) acquire mastership of the created branch when the local repository doesn't have mastership of package. The default is controlled by the [UserInterface]vbranch_acquires configuration setting. (Note that if package is mastered in the local repository, these flags have no effect.)
-f
Force; omit sanity checking. If the -f flag is not given, the parent directory of package/branch must be of type "package" (that is, its type attribute must include this value).

Configuration

The following values are obtained from the [UserInterface] section of the Vesta configuration file (vesta.cfg).

AppendableRootName
The filename under which the global root directory of Vesta repositories is mounted. Ordinarily set to /vesta.
MutableRootName
The filename under which the local tree of mutable directories provided by Vesta is mounted. Ordinarily set to /vesta-work.
DefaultPackageParent
The default directory to put new packages in. Ordinarily a subdirectory of the appendable root, named with an Internet domain name belonging to the local site.
DefaultWorkParent
The default parent directory for mutable working directory trees belonging to individual users. Ordinarily the same as the mutable root.
realm
Global user names are formed by appending @realm to the local name. This setting is optional. If it is not set, [Repository]realm is used.
TimeFormat
A format string for strftime(3) to produce time strings for Vesta attributes. A common setting is "%a %b %e %T %Z %Y".
vbranch_acquires
Sets the default policy for which repository should have mastership of the created branch when the master repository of the parent directory is remote. If it is equal (witout regard to case) to "yes", "on", or "true", or can be parsed as an integer that is non-zero, the local repository will acquire mastership (as if the -m flag had been given). If it is equal (witout regard to case) to "no", "off", or "false", or can be parsed as an integer that is zero, the master repository of the parent directory will retain mastership of the created branch (as if the -M flag had been given). If not set, defaults to "false".

The following values are obtained from the [Repository] section of the Vesta configuration file.

VestaSourceSRPC_host
The host name of the default (local) repository.
VestaSourceSRPC_port
The default TCP port number for repositories.
realm
Global user names are formed by appending @realm to the local name. This setting is only used if [UserInterface]realm is not set.

Limitations

vbranch is atomic if it modifies only the local repository. If a remote repository must be modified, however, the action performed at each repository is individually atomic, but vbranch can die between the actions on the remote and local repositories. To make this problem less likely to occur, vbranch ignores SIGINT (the ^C interrupt) during the critical section.

See Also

vesta-intro(1), repos-ui(1)

Author

Tim Mann

Last modified on Wed Nov  5 22:07:15 EST 2003 by ken@xorian.net
     modified on Tue Apr 29 23:58:57 PDT 2003 by mann
     modified on Wed Feb 19 15:22:16 PST 1997 by heydon
This page was generated automatically by mtex software.