简体   繁体   中英

Compatibility merge workflow in Mercurial

Besides "default" I have a "compat" branch in my repository which exists to support older versions of Python. So the default workflow is that I implement features in "default", merge to "compat" and fix all compatibility issues there. This is a typical patch workflow and works really fine.

But what if I want to introduce some changes which shouldn't be in the "compat" (eg features which won't work on older versions). To not break my default workflow I would have to merge "default" and then backout all changesets which shouldn't be in this branch in the first place.

Is there any better approach to deal with this issues (which doesn't break my default workflow)?

You could create a new branch/bookmark off the default branch for your changest that you don't want in compat. When you're done, you can merge that branch/bookmark into default, then merge it into compat, back it out the merge, then commit.

hg update default
hg merge NonCompatFeature
hg commit -m "Merging NonCompatFeature -> default."
hg update compat
hg merge NonCompatFeature
hg revert --all -r compat
hg commit -m "Merging NonCompatFeature -> compat."

The only way that I can think of to avoid dummy merges would be to change your workflow a little by mirroring the set up you have with the compat branch to add another branch to implement changes that require newer versions of Python (maybe called latest )

You'd implement features that are compatible with older versions of Python on default and merge into compat as you do now but also merge them into latest .

You'd then fix the compatibility issues on compat as you do now and implement features that require new features of Python on latest in a similar fashion.

You'd never merge from latest or compat into default so their changes wouldn't interfere with each other.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM