How to use Shelve extension of Mercurial

The Shelve extension of Mercurial is useful to temporarily store away your uncommitted changes and then restore them back. For example, if you are working on some changes, and before you commit it, someone comes in and asks you to test something on an earlier version. You can shelve away your changes, finish the testing and unshelve the changes and continue.

  • The Shelve extension needs Mercurial 2.8 or later. If you have an older version of Mercurial, install the latest version.

  • If your Mercurial installation does not include the Shelve extension, it can be installed from PyPI using PIP:

$ sudo pip install hgshelve
  • Enable the extension by adding this line to your hgrc:
shelve =
  • To shelve your uncommitted changes:
$ hg shelve

It will be stored using the name default. You can provide other names if you wish.

  • To unshelve these changes later:
$ hg unshelve

Tried with: Mercurial 2.8.2 and Ubuntu 12.04

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s