The graph looks like this since the revisions are ordered by their revision numbers. The main repository has the revisions ordered and numbered like this:
0 Imported initial repo.
1 Trivial change to also echo b.
2 Added another echo for c.
3 Echo for d.
4 Echo for e.
This reflects the order in which the changesets were added to the repository. The feature branch repository has this order:
0 Imported initial repo.
1 Trivial change to also echo b.
3 Added another echo for c.
4 Automatic merge...
5 Echo for d.
6 Automatic merge...
7 Echo for e.
8 Automatic merge...
Again everything is ordered nicely. But when you pull the feature branch into the main repository only the missing changesets are added. The result in main is thus:
0 Imported initial repo.
1 Trivial change to also echo b.
2 Added another echo for c.
3 Echo for d.
4 Echo for e.
5 Refactored echos to print.
6 Automatic merge...
7 Automatic merge...
8 Automatic merge...
and the graph reflects this.
As you note, the repository is fine -- this is only an artifact of how the changesets are ordered on disk. If you want, you could swap the repository with the nice graph for the one with the ugly graph since they now contain the same changesets. Just remember to move any important settings from .hg/hgrc
(copy the file from the clone with the ugly graph).
By the way, when I look at the graph in my clone of http://hg.intevation.org/mercurial/crew/ (the development branch for Mercurial) and compare it to the graph in a fresh clone of http://www.selenic.com/hg/ (the main branch for Mercurial) I see the same phenomenon.