failed to import extension hgext.exportfiles

Got this error message after copying some Mercurial repositories from one machine to another: “failed to import extension hgext.exportfiles”. Huh? Explanation follows.

So what’s going on here is that the target machine didn’t have the exportfiles extension, but the source did.

This extension lets you export all files changed in a revision or a revision range. It’s especially helpful in working with multiple repositories or copies of repositories (as a distributed source control system this is something pretty much anyone using Mercurial will want to do at some point or other).

The export extension (invoked in .hgrc) consists of the exportfiles.py script. On my Fedora systems this should live under /usr/lib64/python2.7/site-packages/hgext.

To call out the extension you would put these lines in ~/.hgrc:

[extensions]
hgext.convert=

The script file can found here. All I had to do was download it to the hgext directory on my machine and the error was cleared.

This entry was posted in Development, System Administration on by .

About phil

My name is Phil Lembo. In my day job I’m an enterprise IT architect for a leading distribution and services company. The rest of my time I try to maintain a semi-normal family life in the suburbs of Raleigh, NC. E-mail me at philipATlembobrothersDOTcom. The opinions expressed here are entirely my own and not those of my employers, past, present or future (except where I quote others, who will need to accept responsibility for their own rants).