buchuki/gitifyhg — pull request #45 by buchuki (2013-02-10 19:07:23+00:00)
Title: Attempt at pushing tags from git to mercurial

I'm constructing this pull request to address #44. I would like some feedback, as I'm not confident this design is completely robust, or even the correct plan of attack at all.

I'm inclined to include it into the next release, though, so we can say, "now supports pushing tags" even if it doesn't support all the edge cases.

What edge cases? I think it works flawlessly if you git tag and git push --tags right away, with no other commits. But if you delay between the tag and push, then the date of the commit message in hg won't be directly matching to the date you made the tag. This doesn't matter with lightweight tags since they don't appear to store a date anyway. Heavyweight tags are the other edge case; I haven't tested that at all. Also, git push --tags origin may or may not work; I've created one test case that passes, but I'm not sure it's tested enough.

Additionally, I'm not very fond of the code in here. It was copied out of mercurial because mercurial's crap-ass API didn't separate logic enough for me to call it in separate steps. And the copied code is ugly. But I don't know if anything prettier would work.