buchuki/gitifyhg — pull request #68 by fingolfin (2013-04-09 16:45:02+00:00)
Title: Replace test suite with sharness

DO NOT MERGE THIS JUST YET! More on this below

This patch series is a first step at migrating to the [sharness](https://github.com/mlafeldt/sharness) test suite, which is directly based on the git.git test suite. Once complete, this has multiple advantages. E.g. the tests are IMO much easier to debug than the current ones; and since they are made from shell code, they are also closer to "manual" tests one would conduct in a terminal. Moreover, this would make it possible to share test code between gitifyhg and remote-hg, if desired.

Indeed, all the tests that are in there right now are directly based on the remote-hg tests. I have not yet looked into migrating any gitifyhg tests.

Those tests already uncovered a regression in the time zone conversion code (introduced as part of some earlier refactoring, it seems), as well as some other differences between the tools.

Some things that need to be done before this could be merged:
* make all tests pass (and fix any bugs uncovered by this)
* port any additional gitifyhg tests, where necessary
* determine why Mercurial phases are different between gitifyhg and remote-hg/hg-git (I think this has to do with differences between how git clones of local hg repositories are done: gitifyhg creates an internal hg clone, remote-hg does not). See also #cf3a5c6.

A lot of tests are failing due to the bugged handling in the fake "master" branch (see also issue #61). I made some progress in resolving that, but I am not sure whether it is worth the effort. It might be wiser to just remove this special case completely, and just refer to the hg "default" branch as "default" resp. "branches/default". But that would break existing clones, and probably would be a bit of a nuisance to users who want things to be as "git like" as possible. Anyway: This must be resolved.

The main reason I am putting this up as a pull request is that I am currently too busy at work to do any further coding on this, and I have the vague hope that somebody else might stop up and help out with this.