No announcement yet.

Merging script help needed

  • Filter
  • Time
  • Show
Clear All
new posts

  • Merging script help needed

    With BC3 pro I need a script or command line interface call that can merge two branches of a file from a common ancestor. Preferably I'd like it to run silently and not open the application.

    A directory contains AncestorTemplate.txt, AncestorModified.txt, and NewTemplate.txt. AncestorModified.txt is an edited version of AncestorTemplate.txt with some inline changes. NewTemplate.txt is an edited version of AncestorTemplate.txt with lines inserted and added.

    I need a way to apply the differences between AncestorTemplate.txt and AncestorModified.txt to the NewTemplate.txt such that I can get a merged output file NewModified.txt containing all the changes.

    I tried finding the differences and outputting a patch file and then applying the patch file to the NewTemplate.txt, but I'm thinking it might be better to go straight to attempting a direct merge of AncestorModified.txt and NewTemplate.txt, ignoring that they share the common AncestorTemplate.txt simply because I'm not likely to run into merge conflicts.

  • #2

    BC3's scripting does not support performing a merge, but you could use the command line arguments:

    bcompare.exe /automerge /force "C:\Left.ext" "C:\Right.ext" "C:\Center.ext" "C:\Output.ext"

    The Help file -> Command Line References chapter has more details on each parameter. You can remove /force (which specifically would add CVS-markers for conflicts into the Output).
    Aaron P Scooter Software