Search code examples
version-controlmercurialmozilla

Create a patch including changes from previous pacthes in hg


I am a git user and a Mozilla volunteer. In Firefox development they use Mercurial instead of git and I have some problems to understand how it works.

Usually, when working on a Firefox bug, I have to upload previous versions of the final patch to get some feedback or reviews. Then, when I want to modify something and upload the new patch, I don't have an easy way to generate a patch including the changes from my previous patch and the news changes I made.

Any idea how to merge the changes from a previous patch with the changes I made after that patch?


Solution

  • It is hard to understand the state of your repo based on your question, and whether you use mq or simple commits, but assuming that you are always commiting your changes in your local repository, you can use the diff command on multiple changesets.

    hg diff -r10:15
    

    The result will be the concatenation of all your changes from revision 10 to revision 15.

    Another option is to use the shelves to merge your changes. Changes in the shelves can be imported over uncommitted changes, allowing you to combine them.