Home

 

Managing conflicts

For the purpose of demonstrating how conflicts can be managed in Team Concert, we describe what happens if Lara-unaware of the changes made by Patrick-decides to change the implementation of the Java prototype, switching to the use of JavaScript (refer to Using scripting inside the JRE).

While logged on as Lara, perform the following steps:

In the Java Perspective, Package Explorer view, expand the package itso.rad75.bank.client. Note that BankClient.java is decorated with an arrow from right to left indicating an incoming change.

Open BankClient.java.

Find the exsting lines:
//Here you can switch the logic to be implemented in Java or Scripting
			executeCustomerTransactions(oITSOBank);
			//executeCustomerTransactionsWithScript(oITSOBank);

Change the lines to use Java Script instead of Java:
//Here you can switch the logic to be implemented in Java or Scripting
			//executeCustomerTransactions(oITSOBank);
			executeCustomerTransactionsWithScript(oITSOBank);

Save the file.

Right-click the file in Package Explorer and select Team Æ Check in. Remember that this action pushes the change set onto Lara's private workspace repository.

Open the Pending Changes view if it is not visible.

You will see an outgoing change set with the label Enter a Comment.

Click the label and type Switch To Java Script.

You will see orange double headed arrows indicating conflicts (Figure | 9-31).

Figure 29-31 Conflicts in the Pending Changes view

Lara tries to Deliver.

(Standard edition only) Lara is prompted to associate a work item with the change set.

Lara creates the new work item called Switch to JavaScript.

When Lara tries to Deliver again, the Team Advisor reports:
Problem
An error occurred during "Deliver".
Cannot deliver changes since they would create conflicts for 
"/RAD75Java/src/itso/rad75/bank/client/BankClient.java". Try accepting all 
incoming changes, resolve the conflicts, then deliver again.

As a result Lara right-clicks on the incoming changes and selects Accept.

When Lara tries to Deliver the change set Switch to JavaScript, the following dialog box appears (Figure | 9-32).

Figure 29-32 Auto-Resolve Conflicts dialog

Click Resolve Later to explore all possibilities for conflict resolution.

Because the conflict was left unresolved, it appears in the Pending Changes view in the Unresolved section for the component (Figure | 9-33).

Figure 29-33 Unresolved conflict in Pending Changes view

By right-clicking BankClient.java in the Unresolved category, options for resolving the conflict are displayed (Figure | 9-34).

Figure 29-34 Possible options for resolving conflicts

Auto Resolve Works by merging nonconflicting changes such as simple additions or removals (but not intra-line differences).

Resolve with proposed Replaces the file in your workspace with the one that contains the conflicting changes.

Resolve with Mine Replaces the file that contains the conflicting changes with the file that is currently in your workspace.

Resolve as Merged Indicates that you have finished merging.

Before deciding which option to use, Lara selects Open in Compare Editor.

In the Java Structure Compare (Figure | 9-35) you can see that the change made by Lara to the main function is seen as outgoing. The changes made by Patrick (deletion of import statements and of two methods) are seen as incoming, and they cannot be overruled using this editor.

Figure 29-35 Compare editor

Lara decides that she wants to preserve her changes, so she right-clicks on BankClient.java in the Unresolved category in the pending Changes view and selects Resolve with Mine.

The Pending Changes view shows the conflict as resolved.

Lara selects Deliver and Resolve Work Item.

When Patrick refreshes the Pending Changes view, he will see the incoming change associated to the work item Switch to Java Script.

After review of the work item description Patrick accepts the incoming change.

Patrick then opens the work item Clean Java prototype and selects Resolve, Won't Fix, because in this case the warnings about unused methods had to be preserved to allow a different choice of implementation in this Java prototype.
ibm.com/redbooks