how to push into git using hg

1 view
Skip to first unread message

Ondrej Certik

unread,
May 3, 2010, 1:04:59 AM5/3/10
to py2js list
Hi,

I am posting here exact instructions how to pull/push things using the
hg-git extension.

$ hg clone git://github.com/mattpap/py2js
$ vim py2js/... # modify some stuff
$ hg ci
$ hg push git+ssh://g...@github.com/mattpap/py2js.git
pushing to git+ssh://g...@github.com/mattpap/py2js.git
importing Hg objects into Git
creating and sending data
** unknown exception encountered, details follow
** report bug details to http://mercurial.selenic.com/bts/
** or merc...@selenic.com
** Mercurial Distributed SCM (version 1.3.1)
** Extensions loaded: rebase, mq, purge, convert, record, hgk, bookmarks, hggit
Traceback (most recent call last):
File "/usr/bin/hg", line 27, in <module>
mercurial.dispatch.run()
File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 16, in run
sys.exit(dispatch(sys.argv[1:]))
File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 27,
in dispatch
return _runcatch(u, args)
File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 43,
in _runcatch
return _dispatch(ui, args)
File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 449,
in _dispatch
return runcommand(lui, repo, cmd, fullargs, ui, options, d)
File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 317,
in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 501,
in _runcommand
return checkargs()
File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 454,
in checkargs
return cmdfunc()
File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 448,
in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
File "/usr/lib/pymodules/python2.6/mercurial/util.py", line 402, in check
return func(*args, **kwargs)
File "/usr/lib/pymodules/python2.6/mercurial/commands.py", line 2333, in push
r = repo.push(other, opts.get('force'), revs=revs)
File "build/bdist.linux-x86_64/egg/hggit/hgrepo.py", line 19, in push
File "build/bdist.linux-x86_64/egg/hggit/git_handler.py", line 148, in push
File "build/bdist.linux-x86_64/egg/hggit/git_handler.py", line 546,
in upload_pack
File "/home/ondrej/usr/lib/python/dulwich-0.5.0-py2.6-linux-x86_64.egg/dulwich/client.py",
line 328, in send_pack
return client.send_pack(path, determine_wants, generate_pack_contents)
File "/home/ondrej/usr/lib/python/dulwich-0.5.0-py2.6-linux-x86_64.egg/dulwich/client.py",
line 123, in send_pack
raise ChecksumMismatch(sha, client_sha)
dulwich.errors.ChecksumMismatch: Checksum mismatch: Expected �G
F?r � TF��^ �0�, got 0000


However, things got pushed in (I checked by git).

So I did:

$ hg pull
$ hg up
$ hg vi # check that things are ok
$ hg push git+ssh://g...@github.com/mattpap/py2js.git
pushing to git+ssh://g...@github.com/mattpap/py2js.git
importing Hg objects into Git
creating and sending data


So all is ok. I use the latest hg-git extension, mercurial 1.3.1 in
Ubuntu Karmic, dulwich 0.5.0, and I have installed dulwich and hg-git
into my PYTHONPATH, and this is my .hgrc:

$ cat .hgrc
[ui]
username = Ondrej Certik <ond...@certik.cz>

[extensions]
hgext.rebase =
hgext.mq =
hgext.purge =
hgext.convert =
hgext.record =
hgext.hgk =
hgext.bookmarks =
hggit =


Ondrej

--
You received this message because you are subscribed to the Google Groups "JavaScript for Python programmers" group.
To post to this group, send an email to js...@googlegroups.com.
To unsubscribe from this group, send email to js4py+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/js4py?hl=en-GB.

Jonathan Fine

unread,
May 3, 2010, 4:39:48 AM5/3/10
to js...@googlegroups.com
Thank you, Ondrej, for these instructions.  I'm sure they'll help me resolve this problem.  As you say, it works for you.

Next time I edit py2js on Github I'll use them.  I'm also intending to adopt a two stage approach, namely

    git clone <github> py2js-git
    hg clone py2js-git

This way, the hg to git push takes place entirely on my machine.

Jonathan

Ondrej Certik

unread,
May 3, 2010, 4:41:34 AM5/3/10
to js...@googlegroups.com
On Mon, May 3, 2010 at 1:39 AM, Jonathan Fine
<jonatha...@googlemail.com> wrote:
> Thank you, Ondrej, for these instructions.  I'm sure they'll help me resolve
> this problem.  As you say, it works for you.
>
> Next time I edit py2js on Github I'll use them.  I'm also intending to adopt
> a two stage approach, namely
>
>     git clone <github> py2js-git
>     hg clone py2js-git
>
> This way, the hg to git push takes place entirely on my machine.

Yes -- except that this didn't work for me (but maybe I was doing
something wrong). If I find some time, I can try to look into it,
maybe it's trivial to fix. It's pure Python after all.

Ondrej
Reply all
Reply to author
Forward
0 new messages