Introduction to TeamWare Configuring |
3 |
![]() |
Coordinating the Work of Software Developers
Managing large programming projects involves coordinating the work of developers who share common and interdependent files.
Copy-Modify-Merge Model
Sun WorkShop TeamWare assists in the development and release of large software projects. TeamWare is based on a concurrent development model called Copy-Modify-Merge. Isolated (per developer) workspaces form the basis of the TeamWare Configuring model. With TeamWare Configuring, you (the developer) copy source you want to change from a central workspace into your own workspace, modify the source to your liking, and then merge your changes with changes made by other developers in the central workspace.
The inconvenience of merging changes is outweighed by the productivity increase that results from developers working concurrently. TeamWare Configuring is designed to minimize (and in some cases, eliminate) the inconvenience of merging changes.
Note - A workspace is simply a specially designated SunOSTM directory and its subdirectories.
Copy-Modify-Merge Example
The following is a Copy-Modify-Merge concurrent development model employed by TeamWare Configuring. This example describes a common software development scenario where two developers are working simultaneously on the same or related parts of a project.
Default Configuring
TeamWare Configuring can be customized in ways that modify its default behavior; many of those customizations are discussed in Chapter 7, "TeamWare Configuring Workspace." All source files in a Configuring project are maintained under the UNIX SCCS. TeamWare Configuring only copies files that are under SCCS. Within your workspaces, you use SCCS in the normal way. For example, you:
A Configuring project is created in a top-level workspace from which all others are derived. When other workspaces are created from the original workspace, the original file system hierarchy is recreated to form the new workspace. In the following example, work is begun by a developer in a workspace whose top-level directory is boatspex. The workspace exists under the directory /usr/src/ws.
Note - If you were only working on a portion of the project, you could copy only that portion.
Figure 3-2 Your New Workspace
Parent and Child Relationship
When you copy files from a workspace to create a new workspace, a special relationship is created between the original workspace and the new one. The original workspace is considered the parent of the newly created child workspace. You can acquire files from any Configuring workspace in this manner, and workspaces can have an unlimited number of children. The portion of the file system that you copy from the parent workspace is determined at the time you copy it. You can copy the entire contents of the parent to the child, making it a clone of the parent, or you can copy only portions of the file system hierarchy that are of interest to you. The Configuring transaction used to copy files from a parent workspace to a child workspace is called Bringover.
The parent and child relationship is special because project data is exchanged only between parent and child workspaces. All files contained in a child workspace were either brought over from a parent workspace or created in the child workspace. When development and testing are complete in the child, you can copy the files that were modified or added in the child back into the parent workspace. Once the altered files are present in the parent, they can be copied by other children or passed up another level to the parent's parent workspace. The Configuring transaction for copying files from a child workspace to a parent workspace is called Putback.
Note - If you use the Bringover transaction to copy files to a workspace that does not already exist, the transaction creates a new child workspace and then copies files to it. This special case is called a Bringover Create transaction. You use the Bringover Update transaction to update an existing child workspace.
Workspace hierarchies are formed by repeating Bringover transactions to create child workspaces. The hierarchy of parent and child workspaces forms a pathway through which data is moved throughout the project.
Note - Unless the child is itself a parent, in which case new files can also be copied to it from its children.
Figure 3-3 Using the Bringover Create Transaction to Create a Workspace Hierarchy
Figure 3-4 Copying Files between Workspaces
Reparenting
Parent and child relationships can be changed. Configuring permits child workspaces to be "reparented" to new parent workspaces. Reasons that you might want to reparent a workspace include the following:
Codemgr_wsdata Directory
Every Configuring workspace contains a directory named Codemgr_wsdata that is a subdirectory of the workspace top-level (root) directory. This directory contains text files that Configuring uses to log its actions, and store temporary and permanent data. You can view and alter these files using standard text utilities. Refer to "The Workspace Metadata Directory" for more information.
Modifying Files
Since Configuring workspaces are simply directories within the SunOS file system, all your usual tools and utilities can be used on files and directories in workspaces. Your normal edit/compile/debug process is not altered by Configuring. Copying Files between Workspaces
Once you make and test modifications in a child workspace, you must disseminate them to the rest of the developers working on the project and ultimately to an integration/release workspace.
Bringover and Putback transactions are always initiated from within the child workspace. Both transactions are viewed from the perspective of the child workspace--not the parent's.
Source Code Control System Files
When considering Bringover and Putback transactions, remember that source files are derived from SCCS deltas and are identified by SCCS delta IDs (SIDs). When a file is copied by either a Putback or Bringover transaction, Configuring is manipulating the file's SCCS history file (also known as the s-dot-file). Bringover and Putback Transactions
When you initiate a Bringover Update or Putback transaction, Configuring must make a number of determinations before taking any action. Copying files indiscriminately from one workspace to another could overwrite work that you or another developer want to keep. Configuring must check all files specified for transfer to determine where they stand in relationship to each corresponding file in the other workspace.
Relationships between Files in Parent and Child Workspaces
The previous example describes only one of four possible states of relationship that can exist between corresponding files in parent and child workspaces. The relationship between files in parent and child workspaces governs the way that Configuring behaves when you attempt to copy files via Putback and Bringover Update transactions. Following are descriptions of the four cases and the action Configuring takes in each case: Case 1
Neither the files in the parent nor the corresponding files in the child have been modified since they were put back into the parent or brought over into the child
Case 2
The specified files were not modified in the parent since they were brought over from the parent into the child or put back from the child into the parent.The corresponding files were modified in the child. Case 3
One or more files in the parent were modified since their corresponding files were brought over into the child or put back into the parent from that child. The corresponding files in the child were not modified.
Case 4
Corresponding files were modified in both the parent and child workspaces.
|
|
Summary
The following two tables summarize, first, the action taken by Configuring during a Putback transaction in each of the four cases described above and secondly, for the Bringover transaction.
Resolving Conflicts
During the Putback transaction, Configuring may determine that a file in the parent has been modified since it was last put back from that child or brought over into the child. In that case it blocks the Putback so that the changes are not overwritten and then notifies the user of the potential conflict.
In the case of most conflicts, the options available to the user for resolving conflicts are:
Note - All conflicts are resolved from within the child workspace and from the perspective of the child workspace.