Search code examples
mercurialchange-management

Mercurial cherry picking changes for commit


Say, I made many changes to my code and only need to commit a few of those changes. Is there a way to do it in mercurial? I know that darcs has a feature like this one.

I know hg transplant can do this between branches, but I need something like this for committing code in the present branch and not when adding change sets from some other branch.


Solution

  • MQ as Chad mentioned are one way. There's also more lightweight solutions:

    • Record extension which works roughly the same way as darcs record. It's distributed with mercurial.
    • Shelve extension which allows you to "shelve" certain changes, allowing you to commit only a subset of your changes (the ones that are not shelved)