Merging Versions of a Directory
Merge can merge changes made to a directory (folder) element in two different contributor versions.
Basic Merge Algorithm
The basic procedure for handling changes in a merge operation is the same for all elements, including directory elements:
- At the time of the merge, one contributor is located in a workspace, where the new version will be created); the other contributor is the version in the workspace's backing stream or some other dynamic stream. (You might have specified this second version as part of a particular transaction or change package.)
- If just one contributor makes a change from the contributors' closest common ancestor, AccuRev incorporates the change into the new, merged version automatically.
- If both contributors make a change from the contributors' closest common ancestor, AccuRev regards this as a conflict, which you must resolve during the merge process.
For a more detailed discussion, in the context of changes to the contents of a text file, see Handling Change Sections.
What Constitutes a Change to a Directory?
Given that the algorithm for handling changes is basically the same for all elements, the only thing special about merging versions of a directory is the nature of changes to a directory element.
AccuRev tracks only namespace changes to a directory:
- Initial creation of the directory.
- Renaming the directory.
Moving the directory to another location in the depot's directory tree.
Each of the above changes creates a new version of the directory element.
AccuRev does not track changes to the contents of a directory. For example:
- Adding a new element to a directory or renaming one of its elements not a change to the directory — it's a change to that particular element.
Similarly, removing (with Defunct) an element from a directory is not a change to the directory — it is a change to that particular element.
Each of the above changes creates a new version of the element within the directory, but does not affect the directory element itself.
Directory Merge Procedure
Since AccuRev tracks only namespace changes to a directory, not content changes, execution of the Merge command on a directory element never involves the Merge tool (or third-party tool). A conflict at the namespace-level merge involves making choices in the same one or two dialogs used for all kinds of elements.