Announcement

Collapse
No announcement yet.

merge common files using command line option

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

  • merge common files using command line option

    Hi all,
    I have two merge common files which are present in two different directories.i tired with below command but it only opens the beyond compare and shows the conflict files but i am unable to merge it .
    folder 1 and 2 has file.txt with different changes.

    BCom.exe /automerge C:\folder1 c:\folder2 /mergeoutput=c:\folder3\merge.txt



    Please reply me on this topic.

    Thanks

  • #2
    Originally posted by deepakm View Post
    Hi all,
    I have two merge common files which are present in two different directories.i tired with below command but it only opens the beyond compare and shows the conflict files but i am unable to merge it .
    folder 1 and 2 has file.txt with different changes.

    BCom.exe /automerge C:\folder1 c:\folder2 /mergeoutput=c:\folder3\merge.txt



    Please reply me on this topic.

    Thanks
    Hi all,
    I have found the command which does the above work.but merge ouput is not correct
    below is this command i am running

    call "C:\Program Files\Beyond Compare 3\BCompare.exe" /automerge /sync /force /closescript /ignoreunimportant /fv="Text Merge" /nobackups /ro doc.txt1 doc.txt2 /mergeoutput=doc.txt2

    i have below input files

    doc.txt1

    #define INCLUDE_DEFAULT_PM

    doc.txt2 it is empty and i am merging in this file itself.


    i got the output is
    <<<<<<< doc.txt1 //this is extra and want to avoid it
    #define INCLUDE_DEFAULT_PM
    ======= //this is extra and want to avoid it

    >>>>>>>doc.txt1 //this is extra and want to avoid it


    please anybody help me on this how could i avoid these extra during merge activity.

    Comment


    • #3
      Hello,

      Your current command line has a few extra arguments beyond what you need in place. /closescript is only used for a Script call and the TextMerge is always Read-Only, so you do not need the /ro command. The /force command explicitly uses a CVS style convention, which has the '=====' line present as well. Here is another example:
      http://www.thathost.com/wincvs-howto/cvsdoc/cvs_10.html

      I would recommend loading the two files in the graphical interface to see how the conflict is defined. You can then see some feedback and interact with the output. Please note that you can load a 3rd file in the center as the ancestor by browsing and loading into the Middle pane, as see in this screenshot:
      http://www.scootersoftware.com/morei...shot=TextMerge


      Beyond Compare's merge features work by comparing the left and right files to a third "ancestor" that the left and right files were based on. That's how it tells which changes were made in the left file and which were made in the right. Without a third/ancestor file, every change is treated as a merge conflict. The extra lines you're seeing are added around merge conflicts so you can see where merge conflicts occurred and fix them afterwards.

      To fix the problem you need to include that third file. If you need a more thorough explanation, there's a good writeup on file merging at http://www.ericsink.com/scm/scm_file_merge.html.
      Aaron P Scooter Software

      Comment


      • #4
        Hi

        Hi Aaron,
        Thanks for your valuable reply.i got not yet proper output.i want to do merging automatically.if right file has some addition data which might not be present in center and left file then output is comming based on center.
        result should be merging between left and right. right file's addition data is not comming in merge output.


        call "C:\Program Files\Beyond Compare 3\BCompare.exe" /automerge /sync /closescript /ignoreunimportant /fv="Text Merge" /nobackups doc.txt1 doc.txt2 doc.txt3 /mergeoutput=doc.txt2

        Comment

        Working...
        X