Next: , Previous: File Attributes, Up: Advanced Uses


3.14 Merging

Monotone has two merging modes, controlled by the manual_merge attribute. By default all files are merged in automatic mode, unless the manual_merge attribute for that file is present and true. In automatic mode files are merged without user intervention, using monotone's internal three-way merging algorithm. Only if there are conflicts or an ancestor is not available monotone switches to manual mode, essentially escalating the merging to the user. When working in manual mode, monotone invokes the merge3 hook to start an user defined external merge tool. If the tool terminates without writing the merged file, monotone aborts the merging, reverting any changes made. By redefining the aforementioned hooks the user can not only choose a preferred merge tool, but even select different programs for different file types. For example, gimp for .png files, OpenOffice.org for .doc, and so on. Starting with monotone 0.20, the manual_merge attribute is automatically set at add time for all “binary” files, i.e. all files for which the binary_file hook returns true. Currently, this means all files with extension gif, jpeg, png, bz2, gz and zip, plus files containing at least one of the following bytes:

     0x00 thru 0x06
     0x0E thru 0x1a
     0x1c thru 0x1f

The attribute could also be manually forced or removed using the appropriate monotone commands. Remember that monotone switches to manual merging even if only one of the files to be merged has the manual_merge attribute set.