schacon / hg-git

mercurial to git bridge, pushed to directly from the hg-git plugin in Hg
GNU General Public License v2.0
620 stars 71 forks source link

another hg gpush problem #23

Closed joelturnbull closed 14 years ago

joelturnbull commented 14 years ago

Hi just testing hg-git with a trivial test repo I created on github. I cloned the repo, made a trivial change to a file there and on gpush I get the Traceback below. Any help?

using: Python 2.5.1 Mercurial 1.2
Git 1.6.3.1

pushing to : origin
importing Hg objects into Git
at: 0/2
creating and sending data
** unknown exception encountered, details follow
** report bug details to http://www.selenic.com/mercurial/bts
** or mercurial@selenic.com
** Mercurial Distributed SCM (version 1.2)
** Extensions loaded: bookmarks, hg-git
Traceback (most recent call last):
  File "/usr/local/bin/hg", line 27, in 
    mercurial.dispatch.run()
  File "/Library/Python/2.5/site-packages/mercurial/dispatch.py", line 16, in run
    sys.exit(dispatch(sys.argv[1:]))
  File "/Library/Python/2.5/site-packages/mercurial/dispatch.py", line 25, in dispatch
    return _runcatch(u, args)
  File "/Library/Python/2.5/site-packages/mercurial/dispatch.py", line 41, in _runcatch
    return _dispatch(ui, args)
  File "/Library/Python/2.5/site-packages/mercurial/dispatch.py", line 372, in _dispatch
    return runcommand(lui, repo, cmd, fullargs, ui, options, d)
  File "/Library/Python/2.5/site-packages/mercurial/dispatch.py", line 247, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/Library/Python/2.5/site-packages/mercurial/dispatch.py", line 417, in _runcommand
    return checkargs()
  File "/Library/Python/2.5/site-packages/mercurial/dispatch.py", line 377, in checkargs
    return cmdfunc()
  File "/Library/Python/2.5/site-packages/mercurial/dispatch.py", line 371, in 
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/Library/Python/2.5/site-packages/mercurial/util.py", line 718, in check
    return func(*args, **kwargs)
  File "/Users/joelturnbull/hg-git/__init__.py", line 46, in gpush
    git.push(remote_name)
  File "/Users/joelturnbull/hg-git/git_handler.py", line 120, in push
    self.upload_pack(remote_name)
  File "/Users/joelturnbull/hg-git/git_handler.py", line 395, in upload_pack
    changed_refs = client.send_pack(path, changed, genpack)
  File "/Users/joelturnbull/hg-git/dulwich/client.py", line 225, in send_pack
    return super(TCPGitClient, self).send_pack(path, changed_refs, generate_pack_contents)
  File "/Users/joelturnbull/hg-git/dulwich/client.py", line 126, in send_pack
    refs, server_capabilities = self.read_refs()
  File "/Users/joelturnbull/hg-git/dulwich/client.py", line 112, in read_refs
    for pkt in self.proto.read_pkt_seq():
  File "/Users/joelturnbull/hg-git/dulwich/protocol.py", line 80, in read_pkt_seq
    pkt = self.read_pkt_line()
  File "/Users/joelturnbull/hg-git/dulwich/protocol.py", line 64, in read_pkt_line
    raise HangupException()
hgext_hgext_hg-git.dulwich.errors.HangupException
schacon commented 14 years ago

it means the client couldn't push to the server for some reason - I need to catch the hangup exceptions somehow... what is the url you are pusing to? run 'hg gremote'

joelturnbull commented 14 years ago

hg gremote gives me...

remote.origin.url git://github.com/joelturnbull/hgTest.git

schacon commented 14 years ago

yeah, you can't push to a git:// url - you need to push to a git@ style url, over ssh. either edit the .hg/gitconfig file to update the url or add another remote with the 'Your Clone' url shown in github (git@github.com:joelturnbull/hgTest.git).

joelturnbull commented 14 years ago

ok i see that now in the README...also I was using clone and not gclone. Still not out of the water yet though. Here are the contents of my current .hg/git-config

remote.origin.url git@github.com:joelturnbull/hgTest.git

when I make a change, commit, and do an hg push I get...

abort: repository default-push not found!

I tried a few different urls in hgrc [paths] but no luck. Thanks for your help.

schacon commented 14 years ago

run 'hg gpush' - i haven't hooked up 'hg push' to figure out a git url yet

joelturnbull commented 14 years ago

that did it, thanks