felipec / git

Fork of Junio Hamano's git for users
Other
204 stars 34 forks source link

Changing from local to remote causes error #39

Closed russell closed 11 years ago

russell commented 11 years ago

Hey,

I found this fantastic plugin and i immeaditly started moving my repositories over. I hit one problem though.

$ git clone hg::sphinx-hg sphinx
$ cd sphinx
$ remote add -f upstream hg::ssh://hg@bitbucket.org/birkenfeld/sphinx/
Updating upstream
Traceback (most recent call last):
  File "/usr/local/bin/git-remote-hg", line 1223, in <module>
    sys.exit(main(sys.argv))
  File "/usr/local/bin/git-remote-hg", line 1185, in main
    repo = get_repo(url, alias)
  File "/usr/local/bin/git-remote-hg", line 408, in get_repo
    hg.share(myui, shared_path, local_path, update=False)
  File "/home/russell/.virtualenvs/hg/local/lib/python2.7/site-packages/mercurial/hg.py", line 142, in share
    srcrepo = repository(ui, source)
  File "/home/russell/.virtualenvs/hg/local/lib/python2.7/site-packages/mercurial/hg.py", line 112, in repository
    peer = _peerorrepo(ui, path, create)
  File "/home/russell/.virtualenvs/hg/local/lib/python2.7/site-packages/mercurial/hg.py", line 102, in _peerorrepo
    obj = _peerlookup(path).instance(ui, path, create)
  File "/home/russell/.virtualenvs/hg/local/lib/python2.7/site-packages/mercurial/localrepo.py", line 2440, in instance
    return localrepository(ui, util.urllocalpath(path), create)
  File "/home/russell/.virtualenvs/hg/local/lib/python2.7/site-packages/mercurial/localrepo.py", line 200, in __init__
    raise error.RepoError(_("repository %s not found") % path)
mercurial.error.RepoError: repository .git/hg not found
error: Could not fetch upstream

I tested with the debian default version mercurial - 2.6.2 git - 1.8.1.3

and mercurial - 19375 git - f8abaebab3fe1a1b873f9636ea410ac4007c8fa8

From what i can tell, local repositories are treated differently, I'm assuming this is to save space. I didn't find this to be very intuitive, but the local repository function makes sense. Do you think there would be some way to support both?

I did manage to fix my repository's by copying the .hg directiory into .git/hg, but it took we a while to figure that out.

Thanks, Russell

felipec commented 11 years ago

This should be fixed in the latest version (d16442fb151455c406be37f6e1d44f5af3826ede).

felipec commented 11 years ago

Oh, no... this is different =/

felipec commented 11 years ago

Now it should be fixed with 3457605546be027340e61d326641141dca4c50bf.