Note that there are some explanatory texts on larger screens.

plurals
  1. POMercurial branches with different codebase
    primarykey
    data
    text
    <p>I am struggling with figuring out a good method for handling my work flow using Mercurial. I have read many related questions here on SO and other places but couldn't find a reasonable solution.</p> <p>Suppose I have two branches:</p> <ol> <li>the default branch I do normal development in. Deploying releases from and marking them with release tags</li> <li>a branch for a specific customer that is maintained separately. It runs on a separate version number, branched from an older version of the application.</li> </ol> <p>These two branches are mostly identical now but there are already some differences. Over time, they will drift apart more.</p> <p>It means that I have 4 types of source files:</p> <ol> <li><strong>Type-A</strong>: Files that remain identical in both branches (changes, if introduced, should be present in both). These are most of the files.</li> <li><strong>Type-B</strong>: Files that are only in the default branch and do not need to be merged into the customer branch</li> <li><strong>Type-C</strong>: Files that are only in the customer branch and do not need to be merged into the default branch</li> <li><strong>Type-D</strong>: Files that are present in both branches, have shared code but also contain code that should remain separate and specific to each branch</li> </ol> <p>Development done on the default branch and there are regular releases which are mostly incremental. But I also have these two scenarios:</p> <ol> <li>Some changes done to the default branch, need to also be merged to the customer branch (e.g. a bug or feature that need to be fixed/added to both). </li> <li>A "hotfix" done to the customer branch and cannot be immediately merged to the default branch but needs to be merged eventually at some point.</li> </ol> <p>Problem is that I can't figure out a reasonably simple, clean and safe way to support these two scenarios. Mercurial doesn't have the concept of partial merges or ignoring files on merge. It merges changesets but it insists on including the files that were introduced in previous revisions.</p> <p>Merging default into customer branch or customer into default in these scenarios forces me to add files of Type-B and Type-C. Making a change to file of Type-A that doesn't need be added to the other branch (making it Type-D) introduces a challenge.</p> <p>Now obviously I can work around some of these problems by using compiler defines (thus keeping source files the same in both branches), editing code manually and manually removing files after merges but this doesn't feel like the most efficient and clean way to handle this.</p> <p>Surely this is a common enough work flow that wiser people than me already figured out. Can anyone suggest any method or best practices that can streamline the work in these scenarios? Or is there something fundamentally flawed with my setup?</p> <p>Also, does Git handles these flows more gracefully?</p> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload