Issue #5 new

Unable to clone an empty local repo.

Massimo Santini
created an issue

If you do:

mktmpenv
pip install mercurial
pip install hg-git
cat <<EOF >~/.hgrc
[ui]
username = Massimo Santini <santini@di.unimi.it>

[extensions]
hggit =
EOF
git init repo
hg clone repo clone

you get

** Unknown exception encountered with possibly-broken third-party extension hggit
** which supports versions 2.3.1 of Mercurial.
** Please disable hggit and try your action again.
** If that fixes the bug please report it to https://bitbucket.org/durin42/hg-git/issues
** Python 2.7.4 (default, Apr  8 2013, 11:08:05) [GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.24)]
** Mercurial Distributed SCM (version 2.6-rc)
** Extensions loaded: hggit
Traceback (most recent call last):
  File "/Users/santini/.virtualenvs/153e07ccbfeaba39/bin/hg", line 38, in <module>
    mercurial.dispatch.run()
  File "/Users/santini/.virtualenvs/153e07ccbfeaba39/lib/python2.7/site-packages/mercurial/dispatch.py", line 28, in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/Users/santini/.virtualenvs/153e07ccbfeaba39/lib/python2.7/site-packages/mercurial/dispatch.py", line 65, in dispatch
    return _runcatch(req)
  File "/Users/santini/.virtualenvs/153e07ccbfeaba39/lib/python2.7/site-packages/mercurial/dispatch.py", line 88, in _runcatch
    return _dispatch(req)
  File "/Users/santini/.virtualenvs/153e07ccbfeaba39/lib/python2.7/site-packages/mercurial/dispatch.py", line 747, in _dispatch
    cmdpats, cmdoptions)
  File "/Users/santini/.virtualenvs/153e07ccbfeaba39/lib/python2.7/site-packages/mercurial/dispatch.py", line 516, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/Users/santini/.virtualenvs/153e07ccbfeaba39/lib/python2.7/site-packages/mercurial/dispatch.py", line 842, in _runcommand
    return checkargs()
  File "/Users/santini/.virtualenvs/153e07ccbfeaba39/lib/python2.7/site-packages/mercurial/dispatch.py", line 813, in checkargs
    return cmdfunc()
  File "/Users/santini/.virtualenvs/153e07ccbfeaba39/lib/python2.7/site-packages/mercurial/dispatch.py", line 742, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/Users/santini/.virtualenvs/153e07ccbfeaba39/lib/python2.7/site-packages/mercurial/util.py", line 506, in check
    return func(*args, **kwargs)
  File "/Users/santini/.virtualenvs/153e07ccbfeaba39/lib/python2.7/site-packages/mercurial/commands.py", line 1248, in clone
    branch=opts.get('branch'))
  File "/Users/santini/.virtualenvs/153e07ccbfeaba39/lib/python2.7/site-packages/mercurial/hg.py", line 372, in clone
    destpeer.local().clone(srcpeer, heads=revs, stream=stream)
  File "/Users/santini/.virtualenvs/153e07ccbfeaba39/lib/python2.7/site-packages/mercurial/localrepo.py", line 2534, in clone
    return self.pull(remote, heads)
  File "/Users/santini/.virtualenvs/153e07ccbfeaba39/lib/python2.7/site-packages/hggit/hgrepo.py", line 14, in pull
    return git.fetch(remote.path, heads)
  File "/Users/santini/.virtualenvs/153e07ccbfeaba39/lib/python2.7/site-packages/hggit/git_handler.py", line 204, in fetch
    refs = self.fetch_pack(remote, heads)
  File "/Users/santini/.virtualenvs/153e07ccbfeaba39/lib/python2.7/site-packages/hggit/git_handler.py", line 1042, in fetch_pack
    f.write, progress.progress)
  File "/Users/santini/.virtualenvs/153e07ccbfeaba39/lib/python2.7/site-packages/dulwich/client.py", line 471, in fetch_pack
    refs, server_capabilities = self._read_refs(proto)
  File "/Users/santini/.virtualenvs/153e07ccbfeaba39/lib/python2.7/site-packages/dulwich/client.py", line 172, in _read_refs
    return refs, set(server_capabilities)
TypeError: 'NoneType' object is not iterable
fatal: The remote end hung up unexpectedly

but if you hence add a file and try again, doing

cd repo
touch file.txt
git add file.txt
git commit -mNew
cd ..
hg clone repo clone

everything works as expected.

Comments (0)

  1. Log in to comment