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

Uncomitting locally prevents pushing #263

Closed alexreg closed 10 years ago

alexreg commented 10 years ago

Even specifying the force option doesn't seem to help...

alex-mbp:pdfmarks alex$ hg push -f gh
pushing to git+ssh://git@github.com/alexreg/pdfmarks.git
["git-receive-pack '/alexreg/pdfmarks.git'"]
searching for changes
abort: refs/heads/master changed on the server, please pull and merge before pushing

Any chance you could fix this for the next release? Until then, I'd be grateful to hear of a work-around.

durin42 commented 10 years ago

Do you have a bookmark named 'master'? If not, set one, that may help.

Otherwise, I'm not sure what's going on.

alexreg commented 10 years ago

I do, yeah. Pushing is normally fine, but not when I'm missing a revision in the local Hg branch that doesn't exist in the remote Git branch.

alexreg commented 10 years ago

Okay, so I just tried pushing to an empty local Git repo, and it still fails. Something very odd is going on here.

alex-mbp:pdfmarks alex$ hg push --force ../pdfmarks.git/
pushing to ../pdfmarks.git/
searching for changes
adding objects
abort: git remote error: refs/heads/master failed to update
alexreg commented 10 years ago

Well, any thoughts?

durin42 commented 10 years ago

Afraid not.

alexreg commented 10 years ago

This seems to be related to https://github.com/schacon/hg-git/issues/262, since I get "0 commits found" when I run hg push -f -v gh. Hmm.

alexreg commented 10 years ago

Looks like a dulwich bug. If you use dulwich 0.9.1, it's gone, and so is that other issue... I'll submit a patch presently!