I have a workflow question related to Mercurial (possibly applicable to other DVCS).
The repo is set up using the typical default/stable setup.
You're tasked with building a new feature and expect it to take some time (month+). While working on this feature, you come across a bug that you think should be fixed and applied to production sooner than later. Or perhaps, you notice some code that could be documented better.
My assumption is that you make the fix in default and then switch over to stable and make the fix again (by hand or by applying a patch). Is that correct or should you immediately switch to stable, do the change there and then merge stable into default?
Using a patch seems to make more sense to me. You can make a commit specifically for the bug fix and apply that patch at your convenience. I mean if the bug isn't too nasty, there is no need for urgency and breaking your flow. Right?
So, how do you handle this situation?
Thanks
A bug fix is a change to a system or product designed to handle a programming bug/glitch. Many different types of programming bugs that create errors with system implementation may require specific bug fixes that are successfully resolved by a development or other IT team.
You can go back to the branch point (revision B
), fix the bug there (revision X
) and then merge the fix into both branches (M1
and M2
):
-----B--o----o---M1----o---> stable
| /
|---------X bugfix
| \
\--o---o----M2----o-----> feature
This way you can get your fix in each branch with normal hg merge
operations; no patching, transplanting or MQ'ing required.
Taking the same idea a step further: you could instead go back to the revision that introduced the bug in the first place. By using this as the base for the fix, you'll be sure that you can merge your fix into any branch that contains the bug.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With