Skip Headers

# Merging Project Files

Previous

Next

Project files contain references to the objects in the project. Generally, your project `<projectName>``.mwp` contains the following elements:

- Database information: `<database>`

  - Database tables: `<tables>`

- Descriptors: `<descriptors>`

- Repository: `<repository>`

  - Classes: `<classpath-entries>`

Changes in these parts of the `.mwp` file are usually caused by adding, deleting, or renaming project elements.

To merge project files, you will generally need to merge a project file if another developer has added or removed a descriptor, table, or class, and checked in the project while you were adding or removing descriptors, tables, or classes from the same project. To merge the project's `.mwp` file, use this procedure:

1. Perform a file comparison between the `<projectName>`.`mwp` file in the repository and your local copy. The file comparison shows the addition or removal of a project element inside the owner (that is, `<database>`, `<descriptors>`, or `<repository>`).

2. Insert the XML script to, or delete from your local `<projectName>`.`mwp` file (inside the corresponding owner element). This brings your local code up-to-date to the current code in the code repository.

3. Retrieve any updated files, as indicated by your source control system.

Your local source now matches the repository.

Merging Projects

Another developer has added and checked in a new Employee class descriptor to the `com.demo` package while you were working with the same TopLink Workbench project. To merge your work with the newly changed project, follow these steps:

1. Perform a file comparison on the `<projectName>`.`mwp` file to determine the differences between your local file and the file in the repository. Your SCM system may show the file in merge status.

   The file comparison shows the addition of the `<package-descriptor>` tag and a `<name>` element inside that tag:

       <package-descriptor>
           <name>com.demo.Employee.ClassDescriptor</name>
       </package-descriptor>

2. Insert this XML into your `<projectName>`.`mwp` file (inside the `<descriptors>` element) to bring it up-to-date with the current files in the source repository.

3. Retrieve any new or updated files from your source control system. This includes the newly added Employee class descriptor.

4. Check in files that you have modified.