Mercurial queues (MQ)

Source: Internet
Author: User
Tags mercurial
The patch management problem Patch Management Problems

Here is a common scenario: You need to install a software package from source, but you find a bug that you must fix in the source before you can start using the package. you make your changes,
Forget about the package for a while, and a few months later you need to upgrade to a newer version of the package. if the newer version of the package still has the bug, you must extract your fix from the older source tree and apply it against the newer version.
This is a tedious task, and it's easy to make mistakes.

This is a common scenario: You need to install a software package, but you find a bug that needs to be modified in the source code. You modified the package and temporarily ignored it for a while. You need to upgrade the package to a new version in a few months. If the new version still has bugs, you must extract your modifications from the old version and apply them to the new version. This is a lengthy and tedious task and easy to make mistakes.


This is a simple case of the "patch management"
Problem. You have an "upstream" source tree that you can't change; you need to make some local changes on top
The upstream tree; and you 'd like to be able to keep those changes separate, so that you can apply them to newer versions of the upstream source.

This is a simple example of "Patch Management.

You have an upstream source code that you cannot change;

You need to make some local modifications on the source code;

You want to keep these changes separately and apply them to the new version of the "upstream" source code.


The patch management problem arises in monitoring situations. Probably the most visible is that a user of an Open Source Software Project will contribute a bug fix or new feature to the project's
Maintainers in the form of a patch.

Patch Management problems may occur in many cases. The most common is that users of an open-source software project provide a bug patch or new feature to the project Maintainer in the form of a patch.


Distributors of operating systems that include open source software often need to make changes to the packages they distribute so that they will build properly in their environments.

Operating System distributors that contain open source software often need to make some changes to their distribution packages, so they are suitable for their environments.


When you have few changes to maintain, it is easy to manage a single patch using the standardDiffAndPatchPrograms
(See the section called "Understanding patches"
A discussion of these tools). Once the number of changes grows, it starts to make sense to maintain patches as discrete "chunks of work ,"
So that for example a single patch will contain only one bug fix (the Patch might modify several files, but it's doing "only one thing "),
And you may have a number of such patches for different bugs you need fixed and local changes you require. in this situation, if you submit a bug fix patch to the upstream maintainers of a package and they include your fix in a subsequent release, you can
Simply drop that single patch when you're updating to the newer release.

When you make some changes, it is easy to manage a simple patch with standard diff and patch programs. Once changes increase, maintenance patches become meaningful. For example, a simple patch contains only one bug fix (this patch may modify some files, but it does "one task"). You may have some patches that correspond to different bugs and need to make some modifications. In this case, if you submit a package patch to the upstream maintainers, they will then include your patch. When you upgrade to the new version, you only need to drop the patch.


Maintaining a single patch against an upstream tree is a little tedious and error-prone, but not difficult. However, the complexity of the problem grows rapidly as the number of patches
You have to maintain increases. With more than a tiny number of patches in hand, understanding which ones you have applied and maintaining them moves from messy to overwhelming.

Maintaining a patch on the upstream tree is cumbersome and error-prone, but it is not very difficult. However, the complexity of the problem increases as the number of patches you maintain increases. When there are many patches that need to be processed, understand the patches you have applied and solve them.


Fortunately, mercurial extends des a powerful extension, mercurial queues (or simply "MQ "),
That massively simplifies the patch management problem.

Fortunately, mercurial has a powerful extension, mercurial queues ("MQ"), which greatly simplifies Patch Management.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.