Announcement

Collapse
No announcement yet.

Merge code procedure wise

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Aaron
    replied
    The Algorithm tweaks and Line Weights are different depending on each sample set. I wasn't able to find a combination that automatically improved those files, as the act of Commenting is making the lines sufficiently different as the different combinations I tried always found the later match (Else to Else) instead.

    Leave a comment:


  • Researcher
    replied
    Thank you for the reply it solved my problem.

    I would like to know if the below problem can be solved using these type of settings.
    https://www.scootersoftware.com/vbul...tic-allignment

    Leave a comment:


  • Aaron
    replied
    For this example, if you go to the Tools menu -> File Formats, edit an existing format for these files or create a new + Text format for these files, and in the Grammar tab, add a new + Line weight:
    End Sub (Priority 5, High).

    Using the Text Merge's Session Settings, Alignment tab, make sure you are using Standard. Also update session defaults so this change is applied in future views.

    This combination of settings works for this file example, so that X appears in a() method.
    Last edited by Aaron; 07-Jan-2020, 01:27 PM. Reason: Update session defaults if using for other text merges

    Leave a comment:


  • Researcher
    replied
    Code Set 1 is the common Ancestor , Code Set 2 is incorporated by other and Code Set 3 is the code to be merged(which was created before incorporating set 2).
    We are looking for automation, instead of manual adjustment. Also sometimes the conflicts are not shown for these cases, so for large change set it is not possible for manual adjustment unless we check each code block line-by-line.

    Leave a comment:


  • Aaron
    replied
    Hello,

    To clarify, Code Set 1 is the common Ancestor, Code Set 2 are Your changes, and Code Set 3 is Their changes you need to merge into Your changes? Or is "The Code to be Merged" that is "created before" the oldest, and is the common ancestor?

    Give your Output it looks like CodeSet1 is your Center pane, and Code2 and ToBeMerged are your Left and Right panes.

    For BC4's setup, the Common Ancestor must be in the Center pane for the merge algorithm to work. If Code Set 1 is not the common ancestor, you will need to reconfigure the external diff definition to pass in the variables in the correct order: bcomp.exe c:\left c:\right c:\centerAncestor
    http://www.scootersoftware.com/support.php?zz=kb_vcs

    If CodeSet1 is the correct common Ancestor of Code2 and ToBeMerged, the alignment is matching on a = 1 lines in SubB over the Comment lines in SubA. There isn't a method to prioritize the SubB header line over the a = 1 line, and this pushes all following lines below this alignment. As a quick manual adjustment, right click and Align With the "End Sub" of Left SubA and Align with the EndSub of Right SubA. Does this give you the comparison you are looking for?

    Leave a comment:


  • Researcher
    started a topic Merge code procedure wise

    Merge code procedure wise

    I am using 3 way compare for the following files. But when i merge these 3 code files it merged in wrong order.

    Original File:
    '*************** CHANGE SET 1 ***************
    Code:
    Public Class Form1
        Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        End Sub
        Private Sub a()
            Dim a As String
            Dim b As String
            a = 1
            a = 1
            b = 1
            b = 1
            b = 1
        End Sub
    End Class
    '*************** CHANGE SET 2 ***************
    Code:
    Public Class Form1
        Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        End Sub
        Private Sub a()
            Dim a As String
            Dim b As String
            Dim x As String
            Dim y As String 
            a = 1
            a = 1
            x = 1
            b = 1
            b = 1
            b = 1
        End Sub
    End Class
    CODE TO BE MERGED ( THIS WORKSPACE WAS CREATED BEFORE INCORPORATING CHANGE SET 2)
    Code:
    Public Class Form1
        Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        End Sub
        Private Sub a()
            Dim a As String
            Dim b As String
           ' a = 1
           ' a = 1
           ' b = 1
           ' b = 1
           ' b = 1
           ' c = 1
           ' c = 1
        End Sub
    Private Sub b()
            Dim a As String
            Dim b As String
            a = 1
            a = 1
        End Sub
    End Class
    Merge result :
    Code:
    Private Sub a()
            Dim a As String
            Dim b As String
            Dim x As String
            Dim y As String
    
           ' a = 1
           ' a = 1
           ' b = 1
           ' b = 1
           ' b = 1
           ' c = 1
           ' c = 1
        End Sub
    
        Private Sub b()
            Dim a As String
            Dim b As String
            Dim c As String
    
            a = 1
            a = 1
            x = 1
        End Sub
    Error:
    Code line 'x = 1' should not have been merged with sub b()
    How to merge code procedure wise ? (i.e code from one sub should not be merged with other sub)

    Please let me know if any settings available for proper merging of vb code procedure wise.

Working...
X