tags:

views:

613

answers:

2

I've been dabbling with hg / mercurial lately, namely in conjunction with Fogcreek's Kiln, and I'm trying to figure out what the must-have extensions are. Its a little tricky sifting through their extension list because I'm not interested in testing any buggy or impractical extensions, even if their description sounds awesome.

So, which hg extensions do you use?

[Update] For Completeness, the popularity of each extension is listed On the extension hitlist page

+7  A: 

graphlog and mq are especially tasty.

  1. Convert: convert to and from other systems
  2. Mq (Mercurial Queues): deal with changes as a stack of patches
  3. Forest: lets you commit to and update many nested Mercurial repositories at once
  4. Share: to save time and disk space when working with similar repositories
  5. Hgk: gives a graphical view of history
  6. Graphlog: I always type 'hg glog' not 'hg log'. An ascii art view of history
  7. Transplant: Useful when you only want to merge a few changesets from another branch. The newer hg rebase may have some overlap.
  8. Rebase: A different way to deal with changes as a set of changesets on top of a branch. git users like to rebase. May replace mq for many use cases.
  9. Shelve: A place to stash the working copy's changes if you have to work on something else for a while.
  10. Bookmarks: Name the newest commit on a particular branch. Similar to git branches.
joeforker
graphlog is now built-in and always enabled with `-g` for the log command (and incoming an outgoing IIRC).
Ry4an
Ry4an: "now" meaning in tip? Not in 1.4.1 AFAICT.
Carl Meyer
The `-g` flag for log is to enable git style diffs, which is completely different from `graphlog`.
jamessan
+18  A: 

My own hit list:

The simple ones you must have:

  1. color: colorize output from commands like diff and status, which makes it easier to assess.
  2. pager: browse long output a page at a time.
  3. fetch: pull, update and merge from another repo in one step.
  4. graphlog: display revision graphs in your shell, incredibly useful for looking at the branches in your log history.
  5. hgk: browse the repository with a graphical interface (see also TortoiseHg and Murky)

If you enable pager, you should configure it to not interfere with certain commands:

[pager]
pager = LESS='FSRX' less
ignore = version, help, update, serve, record

The intermediate extensions I highly recommend (and use frequently):

  1. bookmarks: track a line of development with movable markers, much like git's lightweight branches.
  2. record: lets you interactively select hunks of files to commit - perfect for when you are in the middle of one set of changes, and you end up fixing something that should have its own commit.
  3. extdiff: configure an external diff tool (such as meld)
  4. share: have multiple clones use the same repo history

The Advanced extensions I would not be without:

  1. mq: manage a stack of patches. Very powerful, allows layering of patches on top of the tree.
  2. transplant: apply changesets from another branch. Useful for linearising history.
  3. notify: send email notifications when a repo is changed.
  4. rebase: reapply local changes on top of a new parent revision.
  5. inotify: Linux-only, uses filesystem notifications to make status super-fast

All the above are bundled with Mercurial, and are stable and well-tested. I highly recommend all of them.

Non-core extensions worth investigating:

  1. shelve: selectively put aside changes (at the granularity of hunks) and restore them.
  2. attic: similar to shelve, not sure how it is different
  3. acl: selectively allow access to different parts of the repository tree
  4. histedit: manipulate, reorder and fold changesets (like git's interactive rebase)
  5. bigfiles: work with large binary files outside the hg store

I would not recommend the forest extension, as it has been superseded by the subrepo support introduced in v1.3.

gavinb
Any other comments on Subrepo vs. Forest? I'm not positive that either of them are actually useful/usable - which might imply I'm just 'doing it wrong.' I'm particularly interested in a robust improvement to SVN's 'extern'
JJ Rohrer
color does not work on Windows (http://mercurial.selenic.com/bts/issue1579)
Jerome
@JJBigThoughts: I have recently started to experiment with subrepo support, with a view to using it for a very large project. According to the Mercurial authors, subrepo support is still somewhat experimental. Currently it works much like svn:externals, but only a few commands know about subrepos. The basics seem to work well, AFAICT. The main difference is that the version of each subrepo is effectively pinned, as the parent stores a reference to its revision number as well as location (which isn't necessarily a bad thing).
gavinb
@Jerome The colour extension seems to work fine in Cygwin.
gavinb
How about patchbomb? I find it very handy, at least when you do open source stuff and review happens via mailing list.
tonfa
@tonfa: sure, patchbomb looks very useful; I just haven't tried it yet so I can't recommend or comment on it. On a related note, the extensions that Google developed for Go source reviews via Reitveld look very interesting.
gavinb
@Jerome color extension in ANSI mode + tpager are working fine for me on Windows (tpager can be fount on Bitbucket and CodePlex)
alexandrul
color has been fixed in mercurial 1.6
Jerome