Mercurial: shelve vs. mq

540 views Asked by At

I have been using mercurial for a little while, and have been slowly learning it's features. A while ago I learned about shelves, and have been using them happily. Now I am trying to understand patch queues, but from what I read, they sound very similar to shelves. I can save my work without actually committing it, switch branches if I want, and later come back to it. How do these two differ?

Note: I saw this: Mercurial: graft vs. record vs. qrecord vs. shelve vs. transplant vs. dirstate vs. queue, but didn't find that it addressed this.

1

There are 1 answers

1
A. Coady On BEST ANSWER

Patch queues have a superset of the features of shelves. In addition to setting aside work in progress, the major difference is that applying a patch creates a changeset, instead of only changing the working directory. Keeping the patches distinct enables other workflows, such as these from the book:

  • "Refreshing a patch" iteratively, giving you checkpoints you can roll back to.
  • "Stacking and tracking patches", multiple applied patches don't get mixed together.