remote-testgit: factor out RemoteHelper class

Facilitate writing import-export based helpers in python by
refactoring common code to a base class.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
git-remote-testgit: make local a function

Other helpers (such as git-remote-hg) require that 'self.local' is a
function, rather than a variable.
git_remote_helpers: add fastimport library
git-remote-hg: add hgimport, an hg-fast-import equivalent

This class will be used by git-remote-hg to do the heavy lifting.
git-remote-hg: add GitHg, a helper class for converting hg commits to git

This class will be used by HgExport.
git-remote-hg: add hgexport, an hg-fast-export equivalent

This class will be used by git-remote-hg to do the heavy lifting.
git-remote-hg: add GitExporter/GitImporter/NonLocalGit

This is inftrastructure required to implement git-remote-hg.
remote-hg: adjust to hg 1.9

hg 1.0 changed the signature of hg.clone(). Adjust to it.

A real fix would need to check the hg version or try/catch.
git-remote-hg: add the helper

The helper uses the previously added infrastructure.
git-remote-hg: add tests
t5800: clarify skip message

The skip message takes about remote-hg while the tests are about the
general remote helper framework (and don't require hg). Correct the
message.
t5801: skip without hg

The tests for remote-hg require hg, so skip them all when there is no
hg available.
remote-hg: Postel's law dictates we should handle Author<author@mail>

We should handle a missing space before the email part of an author ident
gracefully. See for example the icedtea6 repository.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
remote-hg: another case of Postel's law

This change allows invalid input from Mercurial repositories where the
author is recorded as 'Name <email@blah' (missing the closing '>').

With this change, importing http://scelenic.com/hg itself no longer fails
with:

	fatal: Missing > in ident string: Benoit Boissinot
	<benoit.boissinot@ens-lyon.org <none@none> 1129685868 -0700

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
remote-hg: handle another funny author line from http://scelenic.com/hg

In this case: David Soria Parra <dsp <at> php.net>.

With this last of three Postel patches, remote-hg can import the
Mercurial repository completely.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Mark all remote-hg push tests as broken

For now, remote-hg cannot be used for pushing. The respective tests fail
thusly:

warning: non-alnum alias 'remote:///git/t/trash directory.t5801-remote-hg/empty'
transaction abort!
rollback completed
Traceback (most recent call last):
  File "/git/git-remote-hg", line 101, in <module>
    sys.exit(HgRemoteHelper().main(sys.argv))
  File ".../lib/git_remote_helpers/helper.py", line 197, in main
    more = self.read_one_line(repo)
  File ".../lib/git_remote_helpers/helper.py", line 163, in read_one_line
    func(repo, cmdline)
  File ".../lib/git_remote_helpers/helper.py", line 121, in do_export
    localrepo.importer.do_import(localrepo.gitdir)
  File ".../lib/git_remote_helpers/hg/importer.py", line 27, in do_import
    processor.parseMany(sources, parser.ImportParser, procc)
  File ".../lib/git_remote_helpers/fastimport/processor.py", line 219,
        in parseMany
    processor.process(parser.parse())
  File ".../lib/git_remote_helpers/fastimport/processor.py", line 76,
        in process
    handler(self, cmd)
  File ".../lib/git_remote_helpers/hg/hgimport.py", line 262,
        in commit_handler
    self.idmap[cmd.id] = self.putcommit(modified, modes, copies, cmt)
  File ".../lib/git_remote_helpers/hg/hgimport.py", line 294, in putcommit
    self.repo.commitctx(ctx)
  File "/lib/python/mercurial/localrepo.py", line 1315, in commitctx
    phases.retractboundary(self, targetphase, [n])
  File "/lib/python/mercurial/phases.py", line 201, in retractboundary
    currentroots.intersection_update(ctx.node() for ctx in ctxs)
  File "/lib/python/mercurial/phases.py", line 201, in <genexpr>
    currentroots.intersection_update(ctx.node() for ctx in ctxs)
  File "/lib/python/mercurial/localrepo.py", line 264, in set
    for r in self.revs(expr, *args):
TypeError: 'set' object is not callable

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>