Search code examples
mercurialmercurial-queue

Mercurial Queues - export a patch


I have a mercurial queue patch on my local machine that I need to share with a coworker that I'd prefer not to commit to an upstream repository. Is there a simple way that I can package that patch and share it with him?


Solution

  • mq stores the patches in the .hg\patches\ folder as files without an extension.

    You can copy or email those files and use hg qimport FILE on the other end to bring them into the patch queue on the other repository. Note that if you copy it directly to the target .hg\patches\ folder, you'll need to use the --existing switch so hg knows to not create the file.

    The .hg/patches folder, by the way, can be a repository in itself to track changes in the patch queue itself. You can init it with hg init --mq and commit the current patches by hg com --mq.