Starting and Loading Merging |
15 |
![]() |
Starting Merging from Sun WorkShop
To start Merging from Sun WorkShop:
![]() | Select the Merging icon in the Sun WorkShop window and click on it. |
![]() | Pull down the TeamWare menu from the Sun WorkShop TeamWare Configuring window and select Merging. |
![]() | Select Open from the File menu, or from the Open button. |
Working Directory-- This text field shows the current working directory whenever you start Merging from the Manager or from the command line with no arguments. You can edit this field. Merging interprets the file names you specify in the window as relative to the current working directory. Therefore, you can use such constructs as subdir/filename to specify a file in a subdirectory and ../filename to specify a file in a parent directory. Any file name you specify that begins with a "/" character is interpreted as an absolute path name, not as relative to the current working directory
Left File--The file you specify in this text field appears in the left text pane, also considered the "child" pane.
Right File--The file you specify in this text field appears in the right text pane, also considered the "parent" pane.
Ancestor File--If you enter the name of an ancestor file, Merging will compare it to the files to be merged and identify lines in those files that differ from the ancestor. The automerged file will be based on the ancestor file, but the ancestor file itself is not displayed in any Merging window. If you do not enter an ancestor file name, Merging compares only the left and right files and derives the output file from them. Automerging is not possible without an ancestor file.
Output File--The merged output file takes the name you specify in this text field. Merging uses the name filemerge.out unless you specify a different name, and stores the file in the current working directory.
Open Button--Click on the Open button to load the files you have specified in the text fields.
In a loaded Merging window the names of the left file, right file, and output file are displayed above each text pane. The name of the ancestor file (for a three-way diff only) is displayed in the window header. The "..." buttons to the right of each text field bring up a file chooser.
![]() | Type the following command at a command-line prompt:
|
twmerge [-b] [-r] [-a ancestor] [-f1 name1] [-f2 name2] [- l listfile] [ leftfile rightfile [outfile] ] [-V]
-b
-r
Note - If you use the -l listfile option, then all three input file names (ancestor, leftfile, and rightfile) must be directories. If you do not use the -l listfile option, then any two input file names can be directories, but one of the three must be a simple file name. In this case, Merging uses the file name to find a file with the same local name in each directory.
Does not start up Merging, but displays the version number of the application.
demo% twmerge file_1 file_2 & |
The first file listed appears in the left text pane; the second file appears in the right pane.
Loading Three Files at Startup
To merge the same two files and at the same time compare them to a common ancestor named ancestor_file, change to the directory in which the files are stored and use the following command:
demo% twmerge -a ancestor_file file_1 file_2 & |
The ancestor file is not displayed, but differences between the ancestor file and the two descendants are marked, and the merged output file is based on the ancestor file.
Loading Files from a List File
You can sequentially load files from a list of file names. For example, suppose ancestor versions of a project's source files are stored in a directory named /src. You have been editing the files file_1, file_2, and file_3 in your directory /usr_1, and another developer has been simultaneously editing the same files in the directory /usr_2. You have been given the responsibility of merging the changes to both sets of files, and you want to place the merged versions in a directory named /new_src.
file_1 file_2 file_3 |
demo% twmerge -a /src -1 sourcelist /usr_1/usr_2/new_src & |
This command causes Merging to load /usr_1/file_1 into the left text pane, /usr_2/file_1 into the right text pane, and compare both files to the common ancestor /src/file_1. After you have resolved the differences between the two files, choose Save from the File menu to automatically save the output file as /new_src/file_1.
Saving the Output File
Save the output file by clicking on the Save button or choosing Save from the File menu. The name of the output file is the name you specify in the Output File test field of the Load pop-up window.