felipec / git

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

HG 2.2.2 funnies? #37

Closed rvl closed 11 years ago

rvl commented 11 years ago

Hi Felipe,

I was using version 1f920420 of git-remote-hg and it was kind of going ok. Then I tried updating to the latest version from your repo.

Creating a new clone, I get this error:

rodney@solaria:~/dev % git clone hg::ssh://hg@bitbucket.org/me/myrepo myrepo2
Cloning into 'myrepo2'...
requesting all changes
adding changesets
adding manifests
adding file changes
added 392 changesets with 3684 changes to 2843 files (+3 heads)
searching for changes
no changes found
Traceback (most recent call last):
  File "/home/rodney/bin/git-remote-hg", line 1128, in <module>
    sys.exit(main(sys.argv))
  File "/home/rodney/bin/git-remote-hg", line 1096, in main
    repo = get_repo(url, alias)
  File "/home/rodney/bin/git-remote-hg", line 398, in get_repo
    bookmarks.updatefromremote(myui, repo, rb, url)
  File "/usr/lib/python2.7/dist-packages/mercurial/bookmarks.py", line 195, in updatefromremote
    rb = remote.listkeys('bookmarks')
AttributeError: 'dict' object has no attribute 'listkeys'

I was thinking this could be due to a change in mercurial. I am running version 2.2.2.

I worked around this problem by changing contrib/remote-helpers/git-remote-hg:398 to

        bookmarks.updatefromremote(myui, repo, peer, url)

However the next error I got was:

rodney@solaria:~/dev % git clone hg::ssh://hg@bitbucket.org/me/myrepo myrepo2
Cloning into 'myrepo2'...
requesting all changes
adding changesets
adding manifests
adding file changes
added 392 changesets with 3684 changes to 2843 files (+3 heads)
searching for changes
no changes found
Traceback (most recent call last):
  File "/home/rodney/bin/git-remote-hg", line 1127, in <module>
    sys.exit(main(sys.argv))
  File "/home/rodney/bin/git-remote-hg", line 1109, in main
    do_list(parser)
  File "/home/rodney/bin/git-remote-hg", line 587, in do_list
    heads = [h for h in heads if not repo[h].closesbranch()]
AttributeError: 'changectx' object has no attribute 'closesbranch'

Not sure what to do now, apart from go back to the working version. Is there a specific mercurial version which is required?

Cheers,

Rodney

felipec commented 11 years ago

Quick update. I've fixed a bunch of issues for backwards compatibility, but I'm rebasing and cleaning the fixes, which would take time.

In the meantime it's probably better to use the 'master' branch in git.git, which should work with Mercurial 2.2.

felipec commented 11 years ago

Should be fixed in fc/master.

rvl commented 11 years ago

Thanks for that. The version from git.git master works for cloning repos. The latest fc/master version still shows AttributeError: 'dict' object has no attribute 'listkeys' with Mercurial 2.2.

felipec commented 11 years ago

That's not possible. I've tested with all versions of Mercurial since v1.9:

https://travis-ci.org/felipec/git/

Are you sure you are using the latest? 181a151.

rvl commented 11 years ago

You're right, I probably forgot to git pull felipec fc/master. fcd1c00f can fetch without that error. Thanks.