internal fragmentation

a personal journal of hacking, science, and technology

October development summary

Fri, 9 Nov 2012 13:07 by mpm in Uncategorized (link)

October by the numbers:

  • released 2.3.2 and 2.4-rc
  • reviewed and merged 154 csets
  • authored 18 changesets
  • wrote 142 mailing list messages
  • worked on 91 bug reports
  • started 2.4 code freeze

The 2.4 release on November 1st marked the first year of our new three-month release cycle and seems to have gone off without a hitch.

May development update

Fri, 15 Jun 2012 12:06 by mpm in Uncategorized (link)

May was extra-busy due to the sprint and travel.

  • released Mercurial 2.2 and 2.2.1
  • reviewed and merged 216 changesets
  • authored 25 changesets
  • wrote 230 mailing list messages
  • worked on 48 bugtracker issues
  • attended 2.3 development sprint in Copenhagen
  • daily IRC office hours

Here we can see the inverse correlation between amount of incoming contributions and time available to do my own coding. I am in fact still catching up on submissions from the sprint. One of my favorite is keyword search in help:

$ hg help -k keyword

 config     Configuration Files
 extensions Using Additional Features
 revset     Specifying Revision Sets
 templating Template Usage


 bisect subdivision search of changesets
 diff   diff repository (or selected files)
 log    show revision history of entire repository or files


 keyword expand keywords in tracked files

April status update

Thu, 31 May 2012 23:39 by mpm in Uncategorized (link)

April was busier than usual. In addition to prepping the 2.2 release, I spent much of the month working with engineers from a large Mercurial user on performance tweaks.

  • released 2.1.2
  • started 2.2 code freeze
  • reviewed and merged 162 changesets
  • wrote 208 mailing list messages
  • authored 49 changesets
  • worked on 64 bugtracker issues
  • work on making our new buildbot happy
  • worked on several performance improvements
  • daily IRC office hours
  • prepared for 2.3 sprint

A number of core algorithms are significantly faster in the 2.2 release, and there’s more on the way.

March development summary

Fri, 27 Apr 2012 17:52 by mpm in Uncategorized (link)

What I was up to in March:

  • released Mercurial 2.1.1
  • reviewed and merged 68 changesets
  • authored 39 changesets
  • wrote 157 mailing list messages
  • worked on 110 bug tracker issues
  • daily office hours
  • fixed a few long-standing case-folding and merge bugs
  • did various performance tweaks
  • started working on new consensus merge algorithm
  • started planning for 2.3 sprint

Probably the most interesting development this month was research into a more powerful merge algorithm, which I’m calling consensus merge. With any luck, this should be ready for testing in 2.3.

February development summary

Fri, 2 Mar 2012 17:14 by mpm in Uncategorized (link)

What I was up to in February:

  • released Mercurial 2.1
  • reviewed and merged 103 changesets
  • authored 27 changesets
  • wrote 160 mailing list messages
  • worked on 156 bug tracker issues
  • begin work on generic templating for all commands
  • various bug fixes
  • daily IRC office hours

The generic templating feature is an idea I’ve been kicking around for a while. The idea is be able to add templating support to commands with minimal code impact, while simultaneously adding support for generic formats like XML and JSON. You can read about the basics in this thread.

(The other big recent feature, of course, is phases, which were released in Mercurial 2.1.)

December and January development summaries

Wed, 29 Feb 2012 16:42 by mpm in Uncategorized (link)

Catching up on my “paperwork” from the run-up to the 2.1 release.


  • released Mercurial 2.0.1
  •  reviewed and merged 123 changesets
  •  authored 15 changesets
  •  wrote 183 mailing list messages
  •  worked on 98 bug tracker issues
  •  worked on design and review for phase support
  •  improved bookmark handling for pull and update
  •  daily IRC office hours


  •  released Mercurial 2.0.2 and python-hglib 0.2
  •  reviewed and merge 210 changesets
  •  authored 56 changesets
  •  wrote 277 mailing list messages
  •  worked on 138 bug tracker issues
  •  worked on design and review for phase support
  •  rewrote copy detection for diff and status
  •  improved handling of large revsets
  •  added support for full fileset queries in revsets
  •  numerous bug fixes
  •  daily IRC office hours


November update and Mercurial release numbering

Mon, 26 Dec 2011 17:18 by mpm in Uncategorized (link)

As always, things have been busy here, and it’s taken a while to get all the paperwork for this year’s fellowship lined up so my updates have dropped off for a few months. But work has continued apace and here’s what happened in November:

  • released Mercurial 2.0 and python-hglib 0.1
  • reviewed and merged 136 changesets
  • authored 43 csets
  • 138 mailing list messages
  • worked on 80 bug tracker issues
  • work on case folding, revsets, test harness, error messages, phase support
  • daily IRC office hours

The big item above, of course, is the release of Mercurial 2.0. So what are the big exciting new features in 2.0? You may be surprised to learn that 2.0 is actually a pretty boring release and that’s the way we like it.

For many projects, an x.0 release often means a major rethink/rewrite/break with the past. And if you look at projects like Python 3.0, Gnome 3.0, KDE 4.0, and so on, you’ll see that that kind of approach is often extremely unpopular with existing users.

Mercurial has a different philosophy: we recognize that an SCM is something that people plan on using for years if not decades. People often build elaborate frameworks and build systems around them and breakage here can mean losing many developer-days of time. So we take care to avoid affecting people’s existing work flows and automation. Regressions get more attention than other bugs.

Further, Mercurial takes an evolutionary approach to development.: steady accumulation of reliable small improvements, with regular releases. So almost all of the changes in the three and a half years since 1.0 have been in users’ hands for a while now. Our 2.0 release is simply 1.9 + .1. So why not just call it 1.10? First, we already know we will never do a release of the traditional 2.0 style, so there’s no point sticking on 1.x forever. Second, the difference between 1.0 and 2.0 is actually huge, notwithstanding the fact that most of the intermediate development has already been released to the public.

Similarly, I can tell you today when Mercurial 3.0 will be released: May 1st, 2014. And it will contain a huge number of interesting new features. But you won’t have to wait for 2014 to use them: they’ll all be released as soon as they’re ready. And none of them will require you to “upgrade” your repositories or all your users’ installs to keep working.

How to find rename data in Mercurial

Wed, 24 Aug 2011 11:27 by mpm in Uncategorized (link)

A fairly common question from new Mercurial users is “how do I figure out where/when a file got renamed?”

As an example, let’s look at the history of a file in the main Mercurial source that got renamed in the distant past. Start with something like this:

$ hg status --rev 10 --copies mercurial/
A mercurial/

This says was copied from some time between the checkout and rev 10. We can even figure out where that happened:

$ hg log -v -r 'limit(follow("mercurial/") and file("mercurial/"), 1)'
changeset:   1089:142b5d5ec9cc
date:        Sat Aug 27 14:21:25 2005 -0700
files:       mercurial/ mercurial/
mercurial/ mercurial/ mercurial/
mercurial/ mercurial/ mercurial/
mercurial/ mercurial/ mercurial/
Break apart

- move the various parts of into their own files
- create to store node manipulation functions

The magical -r argument can be read as:

“Find all revisions in the history of where it still has that name and show just the first one”

See ‘hg help revsets‘ for more info.

But we usually don’t need anything nearly that complicated. This simple command works where this file hasn’t existed multiple times:

$ hg log -l 1 -r 0: mercurial/
changeset:   1089:142b5d5ec9cc
date:        Sat Aug 27 14:21:25 2005 -0700
summary:     Break apart

In other words “starting at rev 0, list one commit mentioning”

Here we can see exactly what happened in that crazy commit: lots of files copied from These are all ‘copies’ and not ‘renames’ because continues to exist.

$ hg status --change 1089 -C
M mercurial/
M mercurial/
A mercurial/
A mercurial/
A mercurial/
A mercurial/
A mercurial/
A mercurial/
A mercurial/
A mercurial/
A mercurial/
A mercurial/

And lastly, we can do:

$ hg diff --git -r 10 mercurial/
diff --git a/mercurial/ b/mercurial/
copy from mercurial/
copy to mercurial/
--- a/mercurial/
+++ b/mercurial/
@@ -1,575 +1,2058 @@
-# - repository classes for mercurial
+# - read/write repository class for mercurial
-# Copyright 2005 Matt Mackall

The  ‘–git’ flag asks Mercurial to use git’s non-standard diff format to show copy/rename info, and Mercurial thus shows a diff against from revision 10 rather starting with an empty file.

We obviously can’t do all of this in the web interface, but we can still easily track down file origins:

May and June maintainer updates

Thu, 7 Jul 2011 16:13 by mpm in Uncategorized (link)

Momentum from the 1.9 sprint carried on pretty well right through the 1.9 release. Now that things are a bit quieter, time to catch up on paperwork.


  • 1.8.3 release
  • reviewed and merged 303 changesets
  • authored 42 csets
  • wrote 304 mailing list messages
  • weekly GSoC meetings
  • daily IRC office hours


  • 1.8.4 release
  • reviewed and merged 237 csets
  • authored 55 csets
  • wrote 222 mailing list messages
  • created the new filesets feature
  • weekly GSoC meetings
  • daily IRC office hours

April maintainer update

Wed, 4 May 2011 14:42 by mpm in Uncategorized (link)

Mercurial development in April was quite busy, ending with our 1.9 sprint.

  • Released Mercurial 1.8.2
  • Reviewed and merged 214 changesets
  • Authored 37 changesets
  • 222 mailing list messages
  • Worked on refactoring merge and rebase
  • Worked on threading of our test harness
  • Worked on encoding and revset features
  • 1.9 sprint!
  • GSoC application review
  • Daily office hours
Older Posts »