No announcement yet.

3-Way Merge - Force conflict for specific lines

  • Filter
  • Time
  • Show
Clear All
new posts

  • 3-Way Merge - Force conflict for specific lines

    Hey Scooter Software Community,

    We're using BC4's 3-way merge tool to reconcile differences between production and development versions of files. Due to how we manage our dev files are managed, they often contain references to other items within our development environment. When we merge dev changes into production, we don't want these dev references to be deployed.

    For example, in the Dev file we're referencing another Dev resource. Right now, because only a change has been detected on the left, the "_dev(001)_" change is merged into the output, without raising any conflicts.

    Dev File (Left)
    INCLUDE "_dev(001)_Include.pdi"

    INCLUDE "Include.pdi"

    Live File (Right)
    INCLUDE "Include.pdi"

    INCLUDE "_dev(001)_Include.pdi"

    Desired Output (ignore change, prevent dev reference from going live.)

    At minimum, is there a way to use a regular expression to detect this line and always raise a conflict if present?

    I don't believe it would be reasonable to expect this but is it possible to automatically detect and ignore this difference to get the desired output?

    Because of this, we're unable to confidently utilize the automerge functionality to streamline basic set lives.


    As an aside, has the option to enable a pop-up to warn about unresolved conflicts been added yet? It appears this was still on the customer wishlist from 2010 to 2016 based on the following post, and still seems to be missing from the current release.

  • #2

    Beyond Compare's Text Merge isn't designed to handle this scenario, but we could accomplish something similar in a two-pass, graphical method. If you create a grammar element in the File Format to match on your "tag" _dev(\d\d\d)_, then mark this element as Important, and Everything Else as Unimportant in the Session Settings, Importance tab, this should leave you with only this text as Important.

    Toggle on Ignore Unimportant Differences to hide all other differences as black text (instead of blue), then you can navigate to each Differences (not conflicts) and take the Other Side (without _dev_). This would leave the output with the non-dev sides take. You can then go back to the Session Settings Importance tab, and invert the items (so Everything Else is Important and the tag is unimportant) to perform the second pass and merge the file.

    The Conflict Save behavior is something still on our radar; I've added your notes to our entry on the subject.
    Aaron P Scooter Software


    • #3
      I should add that I've added this scenario to our Customer Wishlist, along with notes about raising the conflict, or defining something similar to a Text Replacement for the variable name, so it could be treated as the regular version of the variable name for merging purposes.
      Aaron P Scooter Software