Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2017
    Posts
    1

    Default 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. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,623

    Default

    Hello,

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •