"hg-fast-export" is a Broken Piece of Shit


The bullshit claims echoed by every mention of "hg-fast-export" on the web: "It works great and it's so easy! All you have to do is this:"

/path/to/fast-export/hg-fast-export.sh -r /path/to/your/mercurial/repository

Uh huh. The reality:

Traceback (most recent call last): File "C:\DevProj\fast-export\hg-fast-export.py", line 6, in from mercurial import node ImportError: No module named mercurial

Wow! If that's a Python program "just working", then Python can properly fuck off. Note that I'm not writing any goddamn Python here, just trying to use some Pythoner asshole's useless script.

So ok, an hour dicking around on StartPage later, and I find some vague mention of solving the problem by (re?)installing a fairly specific version of Python, and a very specific mercurial installer (Yes, I already had Mercurial installed - no idea what version and honestly don't give a fuck). The Mercurial installer, naturally, failed to install. Found another (purely by guessing) that did work.

So try again:

[/path/to/fast-export]/hg-fast-export.sh -r [/path/to/your/mercurial/repository] Error: No --marks option given Usage: hg-fast-export.py [options] Options: blah blah blah jerk off blah blah blah

Note that not one fucking mention of hg-fast-export anywhere on the goddamn web makes any fucking mention of any "--marks" parameter, let alone that it's required. Let's see what the help screen says:

--mapping=MAPPINGFILE File to read last run's hg-to-git SHA1 mapping --marks=MARKSFILE File to read git-fast-import's marks from --heads=HEADSFILE File to read last run's git heads from

Holy fucking useless bullshit, Buttman! So I'm supposed to know and give a fuck what that shit's all about? And naturally, the included readme file makes absolutely no mention of this flag whatsoever. In fact, the example in the readme file doesn't even fucking use it!

Fine, kiss my ass you piece of shit:

[/path]/hg-fast-export.sh -r [/path/repo] --marks=i_dont_give_a_fuck Error: No --mapping option given [/path]/hg-fast-export.sh -r [/path/repo] --marks=fuckyou --mapping=fuckyou Error: No --heads option given

FUCK! The hell with this shit. Not like I don't have better things I should be doing instead.

The fact of the matter is, all VCS conversion tools/processes are worthless garbage (yes, I've tried many others in the past, going in many different "VCS A -> VCS B" directions). There isn't a damn one that actually works worth a shit, let alone without a pile of unnecessary hoops and such bullshit. Speaking of which, you can cram Cygwin up your ass.

A large part of the blame lies with that piece of shit Python. I don't care what good things anyone has to say about Python: When you have to know anything about language X in order to use a tool merely written in language X, then there's something horribly fucking WRONG with language X. Fuck language X.

Fuck Python, fuck Python scripts toys, and fuck the pathetic state of VCS conversion tools.

(Phew. There, I feel better now...)

(PS: Why was I converting a project from Hg to Git? Certainly not because I like Git - because I don't. I'm just tired of TortoiseHg's shittiness. It's allegedly a Tortoise* tool, but the damn thing can't quite seem to figure that out. TortoiseGit, OTOH, irritates me much less.)

21 comments for ""hg-fast-export" is a Broken Piece of Shit"

  1. (Guest) guest
    2013-03-23 21:14

    Breath in, breath out. Don't install any custom versions, if you have mercurial working, you also have the correct python version. Just set PYTHON=/your/path/to/python2 before running the script. If that doesn't work, read up on PYTHONPATH and blame windows for putting stuff all over the place, not python ;)

    And no - if you have the latest version of fast-export checked out, it does not require any other options. Works as described.

  2. 2013-03-25 11:43

    "Breath in, breath out." Heh, :)

    But if Python can't keep the right scripts running on the right version of the runtime (Java figured out how to get that right ages ago), then I'm going to classify that as a Python problem.

  3. (Guest) Frustrated-in-SF
    2013-04-22 17:19

    Hey I got the same problem!
    And updating fast-export doesn't work!
    For being the #1 hit on Google for this issue, this page sure has no solution!

  4. 2013-05-02 12:43

    "this page sure has no solution!"

    Yea, sorry 'bout that. I just ended up giving up. :/

    BTW, one of the Internet's biggest myths is that there's such a thing as a #1 hit on Google. Google alters their results for each user based on the user's previous searches (and click-throughs, I think). So any two different people doing the exact same search are likely to get a totally different ordering, or even a different result set. That's one of the reasons I use <https://startpage.com> instead. It's like the SRWare Iron of search engines: It takes Google's underlying service but then de-bullshitifies it.

  5. (Guest) guest
    2013-05-31 10:35

    I solved this issue by doing the following before hg-fast-export.sh:
    easy_install mercurial

    It sounds like you already had mercurial installed though, so ymmv.

  6. (Guest) ReckHou
    2013-06-19 22:56

    Yes, it sucks and took me 2 hrs to work that out(I'm using OS X).
    First, it assumes you have installed mercurial in PYTHONPATH, should be /Library/Python/2.7/site-packages/mercurial/. Without that will be "ImportError: No module named mercurial". But you still have to install mercurial through source code instead of .dmg, or it won't work since .dmg won't create mercurial/ under PYTHONPATH.

  7. (Guest) guest
    2013-07-03 01:26

    It's OK, don't take it personally.

  8. (Guest) Chris
    2013-07-31 15:01

    I fully sign this article. python sucks so much :( It should be such a simple Task to run a program.

  9. (Guest) Trey
    2013-08-13 11:06

    Dude, I so felt your pain. I posted a solution on Stack Overflow with the "Windows 7 64-bit Solution" which I think has everything explained for that environment which is a bit of a bugger in my opinion.

    http://stackoverflow.com/questions/1389307/convert-a-mercurial-repository-to-git

  10. (Guest) guest
    2013-08-26 01:02

    I have to say that I have the same problem with hg-fast-export and with python

  11. (Guest) guest
    2013-09-06 22:59

    The only problem are people. It's either due to the person who's using or the person who developed.

  12. (Guest) guest
    2013-12-18 18:50

    Piece of shit is this blog! Dude, if you are using windows as your OS to code you are the real jerk here. Don't blame python to justify the pathetic knowlege you have about the environment your are trying to work with. I used hg-fast-export to migrate a few repos to git and I can tell that it works and is really fast (of course Im not running windows). Maybe you should give up the IT world man. Probably working for mcDonnalds is more your style.
    Good luck!

  13. 2014-06-12 14:00

    It's a "not-a-blog" :)

    While trolls are, as everyone knows, undeserving of acknowledgement or even vaguely "human" status, there is one point here that's worth addressing since there are some actual grownups out there who have fallen prey to it as well:

    "Don't blame python to justify the pathetic knowlege you have about the environment your are trying to work with."

    Any software that requires dicking around with environments before it will even run is categorically piss-poor software, and belongs quarantined to 1970. Not requiring end-users to waste their time screwing with such pointlessness is a decades-long solved problem. Some of us have real work to get done. Playing with your operating system is not real work.

  14. (Guest) guest
    2014-06-30 00:33

    Your language is inappropriate, though.

  15. 2014-07-15 10:23

    Meh, my whole site is inappropriate :)

  16. (Guest) pyrho
    2014-07-18 08:08

    I got it working on windows !
    You need to call hg-fast-export.sh (which calls hg-fast-export.py with the appropriate arguments).

    I used the 'git bash' shell (which looks like some sort of cygwin), you can download it from here: http://msysgit.github.io .
    From this I launched hg-fast-export.sh -r <MYREPO> --force.

    It is currently importing my 67k changesets into git (:

    ps: Thanks for that article, it made my day x)

  17. (Guest) Andrew
    2014-08-07 09:21

    Although your post did not help me, this one did:
    http://learnaholic.me/2013/02/01/converting-mercurial-hg-to-git-repository-on-mac/

    Very entertaining though.

  18. (Guest) guest
    2014-11-16 13:07

    PYTHON=`which python2` /path/to/fast-export/hg-fast-export.sh -r /path/to/your/mercurial/repository

  19. (Guest) John
    2015-11-13 09:02

    Yes, what a load of shite Python package management is and 2/3 compatability problems. It's a nice language for data science though. The above comment helped me get hg-fast-export working on Linux, the OS you should be using for development rather than windows. I agree with the sentiment of your rant, but you were annoyed because of your own failure to get hg-fast-import working rather than hg-fast-import being shit. Also the hg-fast-import authors spent their time writing you software for free, so you have no right to complain.

  20. 2015-11-16 11:33

    @John: We have a right to complain about anything we feel like complaining about. But more to the point:

    Take something that's crap, release it for free...it's still crap. Being free doesn't change that, no matter how much I might appreciate the "released for free" part.

  21. (Guest) geomineral.ru
    2017-06-10 05:22

    As mercurial appears to be much less picky about the syntax of the author information than git, an author mapping file can be given to hg-fast-export to fix up malformed author strings. The file is specified using the -A option. The file should contain lines of the form

Leave a comment

Captcha