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

Tag error on push #92

Closed undees closed 14 years ago

undees commented 14 years ago

The following sequence of steps causes an error:

  1. Fork http://github.com/rubyspec/rubyspec
  2. Clone and commit a change:
    
    hg clone git+ssh://git@github.com/username/rubyspec.git
    cd rubyspec
    ... hack hack hack ...
    hg ci -m "hack"
    
  3. Now, try to push:
    
    hg push
    pushing to git+ssh://git@github.com/username/rubyspec.git
    importing Hg objects into Git
    creating and sending data
    abort: refs/tags/v0.6.2 changed on the server, please pull and merge before pushing
    

Needless to say, no one has actually changed this tag in the newly-created fork, and attempting a pull/merge does nothing. Not all repositories have problems, and I'm not sure what the key difference is between working and broken ones. I don't think it's the mere presence or absence of tags. This is on hg 1.5.1, by the way.

Jaharmi commented 14 years ago

I am also having this problem with http://github.com/Jaharmi/luggage. I have tried to merge changes from my forkqueue locally with Hg, because my forkqueue gets stuck at "Status: Processing 1 of 3 Commits" and never updates. The changes merge cleanly in a local Hg repo after fetching the latest updates from my repo and the original that I forked.

However, because I can't push back to the Github repo with Hg, I'm somewhat stuck (at least without installing Git, I suppose). Perhaps the forkqueue issue will get sorted out, as some people seem to be reporting success here: http://support.github.com/discussions/repos/2677-cannot-apply-commits-in-fork-queue.

rctay commented 14 years ago

It's because the tags are annotated tags. Are you running hg-git's master branch? Some changes to hg-git's handling of annotated have recently been merged in, it might fix your problem (did so for me).

undees commented 14 years ago

Hello, rctay,

I thought I was on the latest from master, but I must not have been. After a fresh clone of hg-git + dulwich, push is working again. Thanks!

Jaharmi, can you confirm that updating to schacon's / durin42's latest code fixes the issue for you as well?

Jaharmi commented 14 years ago

I finally figured out where to get dulwich 0.5.1, which is used by the latest hg-git, and updated both. Easy_install couldn't find dulwich 0.5.1 (discovering only 0.5.0), so updates through that method kept failing.

Once I updated dulwich, I was able to successfully do pushes and pulls with my repo again. This allowed me to sort out my forkqueue issue at Github, by merging changes locally, since applying those commits at Github still didn't work.

Thanks for the help!

durin42 commented 14 years ago

Fixed by hg-git/dulwich tip.