Perforce - Branching and Merging

Branching and Merging

A file is uniquely identified by its complete filename, e.g., //depot/trunk/src/item.cpp. Any non-deleted revision of a file can be branched. Perforce uses inter-file branching, wherein branching creates a new file with a new name. For example, my/index.php may be branched into your/index.php and each file may then evolve independently. Repository paths are typically designated as containers for branched sets of files. For example, files in the //depot/trunk path may be branched as a set into a new //depot/rel1.0 path, resulting in two sets of files evolving independently and between which changes can be merged.

In Perforce, the operation that merges changes from one branch to another is called integration. Integration propagates changes from a set of donor files into a set of corresponding target files; optional branch views can store customized donor–target mappings. By default, integration propagates all outstanding donor changes. Donor changes can be limited or cherry-picked by changelist, date, label, filename, or filename pattern-matching. The system records all integrations, uses them to select common ancestors for file merging, and does not by default perform redundant or unnecessary integrations.

Merging is actually only one of three possible outcomes of an integration. The others are ignoring (aka "blocking") and copying (aka "promoting"). Merging is used to keep one set of files up to date with another. For example, a development branch may be kept up to date with its trunk through repeated merging. Ignoring disqualifies changes in one set of files from future integration into another. It is often used when a development branch must be up to date with, and yet divergent from, its trunk. Copying is typically used to promote the content of an up-to-date development branch into a trunk.

Branching also supports renamed and moved files. The 'move' command branches originals to new files and deletes the originals. A branched file is no different from an added file; branched files are peers, not offshoots, of their originals. The system keeps track of file origins, however, and refers to them when displaying the history of renamed files.

Perforce streams offer a way to capture more information about a branch, including ancestry and included paths. This information is used to provide guidelines for branching and merging operations.

Read more about this topic:  Perforce

Famous quotes containing the words branching and, branching and/or merging:

    The moose will, perhaps, one day become extinct; but how naturally then, when it exists only as a fossil relic, and unseen as that, may the poet or sculptor invent a fabulous animal with similar branching and leafy horns ... to be the inhabitant of such a forest as this!
    Henry David Thoreau (1817–1862)

    The moose will, perhaps, one day become extinct; but how naturally then, when it exists only as a fossil relic, and unseen as that, may the poet or sculptor invent a fabulous animal with similar branching and leafy horns ... to be the inhabitant of such a forest as this!
    Henry David Thoreau (1817–1862)

    You hear a lot of dialogue on the death of the American family. Families aren’t dying. They’re merging into big conglomerates.
    Erma Bombeck (b. 1927)