First, I am new to Mercurial and distributed source control systems as a whole. Generally I have used perforce, so I’m going to use perforce terminology in order to keep what I’m trying to say clear.
My issue is that I’m making a game based on an open source engine, and that engine has regular code drops. However, I am also making some changes to the engine code myself, in my own depot. I need to set things up so that I can easily merge changes from code drops in to my own code, without losing my changes, and without having to examine every single file manually.
In Perforce, what I’d do is have a branch for just the engine code, and then my main branch, and all engine code drops would be submitted to the engine code branch, and then I would integrate the engine code branch in to the main code branch. Resolve problems, submit, and voila.
I feel like this is pretty close to how it would work in Mercurial, only I’m missing some minor piece of understanding to help me figure it out. First, I’m not sure if my engine code should be in a branch, or a completely separate repository. And even if I did know that, I’m not clear as to how I’d move code back and forth and keep them properly separate.
Sorry if this is kind of a kitchen sink question. I tend to learn by tossing myself in the deep end.
It sounds like you could do almost exactly the same thing you do with perforce using named mercurial branches in a single repository:
That’s the initial setup. After that, when you want to add a new drop it’s similar: