dusty-phillips / gitifyhg

Tools for using git as a client to mercurial repositories
GNU General Public License v3.0
62 stars 17 forks source link

Handle "access denied" #50

Closed fingolfin closed 11 years ago

fingolfin commented 11 years ago

I was trying to clone a private SSH repository before access for me was enabled. Using hg this results in this message:

$ hg clone ssh://hg@hg.example.domain/repo
remote: mercurial-server: access denied
abort: no suitable response from remote hg!

But using gitifyhg, I got this ugly stack trace:

$ git clone gitifyhg::ssh://hg@hg.example.domain/repo
Cloning into 'repo'...
Traceback (most recent call last):
  File "/sw/bin/git-remote-gitifyhg", line 9, in <module>
    load_entry_point('gitifyhg==0.7.1', 'console_scripts', 'git-remote-gitifyhg')()
  File "/sw/lib/python2.7/site-packages/gitifyhg.py", line 855, in main
    HGRemote(*[x.decode('utf-8') for x in sys.argv[1:3]]).process()
  File "/sw/lib/python2.7/site-packages/gitifyhg.py", line 303, in __init__
    self.build_repo(url)
  File "/sw/lib/python2.7/site-packages/gitifyhg.py", line 315, in build_repo
    local_path.encode('utf-8'), update=False, pull=True)
  File "/sw/lib/python2.7/site-packages/mercurial/hg.py", line 267, in clone
    srcpeer = peer(ui, peeropts, source)
  File "/sw/lib/python2.7/site-packages/mercurial/hg.py", line 121, in peer
    return _peerorrepo(rui, path, create).peer()
  File "/sw/lib/python2.7/site-packages/mercurial/hg.py", line 101, in _peerorrepo
    obj = _peerlookup(path).instance(ui, path, create)
  File "/sw/lib/python2.7/site-packages/mercurial/sshpeer.py", line 59, in __init__
    self.validate_repo(ui, sshcmd, args, remotecmd)
  File "/sw/lib/python2.7/site-packages/mercurial/sshpeer.py", line 90, in validate_repo
    self._abort(error.RepoError(_('no suitable response from '
  File "/sw/lib/python2.7/site-packages/mercurial/sshpeer.py", line 115, in _abort
    raise exception
mercurial.error.RepoError: no suitable response from remote hg