Let's say you have three development branches going at once (dev 1, dev 2, dev 3), each branch working on different features for a given software product.
If I understand continuous integration correctly, these development lines would each need to constantly check code back in to a shared main line (once it has passed testing), with the shared main line code being merged back in to each dev branch on a regular basis.
What happens though when one of the dev branches (dev 1) is ready for a production deployment, and the other dev branches (dev 2, dev 3) are not? If the dev 1 branch code gets pushed through UAT and in to Production, all code from dev 2 and dev 3 branches that have been 'continuously integrated' in to dev 1 will also get pushed in to Prod, even though features in dev 2 and dev 3 may not be ready (or scheduled) for release.
How can I avoid this problem while still adhering to Continuous Integration?