Change merge preferences when a merge is in progress

Tuesday, November 13, 2012 0 Comments

It's Friday, 5:45 pm.

You are almost ready to get out from work and start the weekend, your last week task involves the merge of two pals branches and leave the integration tests running all over the weekend, no big deal.

You start with the first branch, the merge tool finds over 150 "Changes only in source contributor" merge candidates, easy so far. Your friends just sent you a message, they've arrived to the bar.

The first merge is committed, let's jump to integrate the last branch, you find that the merge detects more than one hundred "Changes in both contributors" merges candidates. More than 100 manual resolution conflicts!!?? In less than 10 minutes!!?? What the hell your pal was working on!!?? He didn't mention rocket science in the scrum meeting!! Good bye weekend.

Keep calm.

You start the merge, first file with manual resolution:
Figure 1: Merge Tool

This one is easy, for some reason there's a new line at the end of the destination contributor file and a new funny footer comment in the source contributor file. Ok, disable the destination contributor and keep the source changes, you prefer the comment rather than the empty line. Save & Exit.

Next conflict. More of the same. You call the developer and he confirms you that he changed all the files by just adding that last comment. No source code, only the comment footer for all the files.

Figure 2: Merging progress

At this point you have two options, you can continue the merge and repeat the operation 133 times or you can pause the merge and tell Plastic SCM to do the work for you. You prefer the second one, right?

But, how can you pause the merge?

Minimize the merge-tool window, take a look into the Plastic SCM merge panel, there's a "Cancel" button on the top.
Figure 3: Cancel Merge from branch

Now, just click in the Cancel button.
Figure 4: Click Cancel Button

Resolve your manual merge conflict in process. Once you complete it the merge panel will be enabled again and you will be now able to select "Source" as the only merge contributor for all your pending conflicts,  only 2 clicks for all candidates.
Figure 5: Preserve source changes for all

Process all the merges with the new configuration and you are done. Commit and leave the tests running.

Now you can get out of work 5 minutes earlier, enjoy!

0 comentarios: