hg-git working with Gerrit

Issue #48 wontfix
created an issue

After all I tried It was not possible to get mercurial working with hg-git against a Gerrit (http://code.google.com/p/gerrit/) server repository. It's possible to pull from the server, but pushing is not allowed on the same branch as the pull from ref/heads/master.

Push must use refs/for/master as target which is the way Gerrit runs it's incoming changes for reviews. see http://gerrit-documentation.googlecode.com/svn/Documentation/2.4.2/user-upload.html#_git_push

How can I specify the git-branch to be used in git push command within hg-git?

Comments (3)

  1. maugustin reporter

    Just for people searching "HG Gerrit" and finding this issue. There is a manual solution, that could be enhanced, but it's working using HG, HGGIT and GIT.

    Create a local branch in HG, marking it with a bookmark.

    hg book feature123

    Export your changes to git. Use [git] intree=1 in your hgrc configuration file to get a .git directory sibling .hg dir. HGGIT exports only branches with bookmarks, because hg-bookmarks are very likely git-branches.

    hg gexport

    For now you have to use the GIT client to push to GERRIT server, as described in the Gerrit manual. E.g. for feature branch with bookmark feature123 pushing to review for branch master:

    git push ssh://username@l/mediawiki-core.git feature123:refs/for/master

    Any changes from Gerrit can be pulled via "git fetch" (not pull, since there is not GIT workarea) and importing to HG using:

    hg gimport
  2. Log in to comment