How does multiple checkouts work in team environments?

SCM Anywhere supports exclusive checkout model and multiple checkout model.

For administrator:

In SCM Anywhere, you can enable multiple checkouts by checking the Allow multiple checkouts option in Admin Explorer:

With the Allow multiple checkouts option checked, SCM Anywhere allows more than one user to check out the same file and work on it simultaneously. This enables parallel development in team environments.

For users:

If you want to set the default behavior of Check Out to be multiple checkouts, you can uncheck the Always request exclusive locks option at "SCM Anywhere Hosted Client ->Options -> General Tab".

When you check out an item, please make sure the "Request exclusive checkout" option is unchecked in the Check Out dialog box.

How merge is performed

Before discussing how merge is performed, we first need to understand the concept of 3 parties in merge and 3 types of change.

3 parties in merge:
To perform a merge, 3 parties are needed: base version, source version and target version.

3 types of change:

  1. Add. We added new lines into the source code;
  2. Delete. We deleted lines from the source code;
  3. Change. We changed the content of a line.

Merge steps:

  1. SCM Anywhere compares the source version against the base version to have a list of changes made in the source version;
  2. SCM Anywhere compares the target version against the base version to have a list of changes made in the target version;
  3. SCM Anywhere tries to apply all the changes in the source version to the target version
    • If there is no conflict, all the changes in the source version are applied to the target version.
    • If there are any conflicts, visual merge is required. SCM Anywhere shows an interface to let us choose if we want the changes in the source version or the target version. We can also edit the content in the visual merge interface.

How Conflict is Detected
If the source version and the target version change the same line of the code, there is a conflict.

Example of merge

For example, the content of the base version is:

In the source version, the content is:

In the target version, the content is:

So in your current version, you have made the following changes:
Added "0" before the first line
Changed 2nd line from "2" to "22"

In the another version, the following changes have been made:
Changed 2nd line from "2" to "222"
Add "5" after 4th line.

For the merge result, "0" is added before the first line, "5" is added after the 4th line. But since both of the versions have changed the second line, there is a conflict. When there is a conflict, it is not possible for SCM Anywhere to merge the files automatically and a visual merge is initiated to let us decide which changes will be kept.

The following is the screen shot for the above scenario:

As we can see that the "0" and "5" are added to the merge result. Since there is a conflict in the second line, the content from the base version, which is "2", is the default content in the merge result. We can choose "222" or "22"for the conflicting line by clicking the mouse on the content we want.