Problems pushing local code repository to mercurial project on Google Code
-
22-09-2019 - |
Question
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?
Solution
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.
OTHER TIPS
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.