Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!


Multiple level undo/redo for Mercurial

hg-multiundo supports multiple levels of undo and redo for any Mercurial operation. [1] The extension provides two commands: hg undo and hg redo for undoing a change and redoing it, respectively.


hg-multiundo is configured in the multiundo section. The configuration elements that are used are:

The level of undo states being maintained. hg-multiundo will save the last undocount states on disk to undo/redo.

Technical details

The undo/redo state is hooked into Mercurial's opener, which Mercurial internally uses for all its file read/writes and using that we can discriminate what files to back up before a change is written to it.

All the undo state files are saved inside .hg/multiundo/ directory. The undo files are not meant to be edited by hand, but only through the use of the undo and redo commands.

Known issues

  • The purge extension does not use Mercurial's opener concept as a file system entry point, so any use of hg purge will not be undo-able.
[1]See the known issues list at the bottom.

Recent activity

Jason Harris

Commits by Jason Harris were pushed to hstuart/hg-multiundo

2d9ce92 - - Move all the multi undo files into the repo/.hg/multiundo/ directory. - Have two trees. An undo root and a redo root. So it's really ...
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.