Joining sections of code when performing a merge

0 Likes

Joining sections of code when performing a merge
SITUATION:
Two developers (in two parallel streams) add a piece of new code at the end of a file, like.

Version A:
100 SOME NEW_FUNCTION
101 int foo;
102 some code here
103 end

Version B:
100 SOME_OTHER_FUNCTION
101 int foo;
102 some other code
103 end

When merging these two files, the merge tool reports a conflict for lines 100 & 102, but matches 101 & 103. This creates a colored mess when the merge tool tries to squeeze the two new code blocks into one.

Is there a way to treat the new code as a continuous block of code, so in this case a single conflict, covering all four lines?


RESOLUTION:
Instead of having to merge line 100 and 102, you can join sections so lines 100-103 are considered one section to merge.

In the GUI merge window, right click on the bottom pane and select, "join sections" you will select lines 100 and 102 to be one section to merge.


For more information contact AccuRev Support

Comment List
Related
Recommended