views:

520

answers:

2

I have a project that I want to push to a Mercurial repository on Google Code.

I initialized a Mercurial project locally and checked in the code locally.

The only instructions I can find on the Google Code repository are for cloning:

hg clone https://blahblah.googlecode.com/hg/ blahblah

But I assumed that pushing should be similar.

So I tried:

hg push https://blahblah.googlecode.com/hg/ blahblah

But I got an error saying "invalid arguments".

One of the options it provides is "force push". Is this what I need?

+2  A: 

If you are trying to push back a repository that you cloned, try

hg push

otherwise try

hg push https://blahblah.googlecode.com/hg/

For future reference, here's the usage information from Mercurial's built-in help system:

$ hg help clone
hg clone [OPTION]... SOURCE [DEST]

$ hg help push
hg push [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]

I think the reason hg push is failing is because you're giving it too many arguments.

las3rjock
He's not trying to push back one he cloned. He's trying to push a repo he created locally.
Ry4an
A: 

Try the 'force'. Force says "and you're allowed to create new remote heads". You google code has no changesets, so no heads, so you're going from zero to one. I still wouldn't expect that 'force' is required, but it's definitely worth the try.

Most people starting a repo from scratch would have cloned the empty repo from google (or bitbucket) first, and then made their changes, and then pushed. I think this is what las3rjock thought you did.

Ry4an