Mercurial clone issue - mercurial

I'm using Mercurial and I've cloned a repo locally and upon hg push, I'm getting this:
abort: cannot lock static-http repository
What does this mean? Why can't it lock the static-http repository? Permission issue on the folder?

You can't because Mercurial doesn't implement push for static-http, you need either the smart protocol, ssh or local access.
See here for more details.

Related

Updating a local mercurial copy with a specific commit from another remote site

(I'm using real examples, so it is clearer.)
I cloned an official Mercurial repository locally
hg clone https://bitbucket.org/Coin3D/soqt -r default
from this repo: https://bitbucket.org/Coin3D/soqt/branch/default
Now I want to update my local copy with a commit taken from a remote fork of the main project:
https://bitbucket.org/roboticslibrary/soqt/branch/patch-hidpi
How can I integrate a specific commit from a remote fork (#214c74a in this example) into my local clone?
With git I would add the remote fork, then I would use "fetch" on that and then I would use "cherry-pick" to get the specific commit.
Is that possible at all in Mercurial?
Thanks a lot!

Mercurial and BitBucket, "abort: repository default-push not found!" error message

I've some code on my laptop I would like to upload through Mercurial on my BitBucket repository.
I'm using a Linux CentOS 6 machine.
The problem is that if I type $hg push, I get the following error message:
pushing to default-push
abort: repository default-push not found!
What should I do?
Thanks
Mercurial doesn't know where you want to push to. Mercurial first looks for the destination in the push command (which could be either a repo on the filesystem, or a remote hg server):
hg push remoterepo
If it doesn't find a destination in the command, it will fall back on the defaults.
Normally, assuming this repository was cloned, the hgrc file (in .hg/) will indicate the default repository to be used.
However this assumes that the repository was created by cloning an existing repo.
If not, you can edit .hg\hgrc and add the default destination eg:
[paths]
default-push=http://yourserver/

Clone mercurial repository to external repository

I have a mercurial server, running RhodeCode, that I commit my code to. My client has a Redmine installation and has requested that code I modify for them be stored on their server (understandable).
I would like to still commit to RhodeCode and after a successful commit, push these changes to their repository automatically. They have their code in both an SVN repository and a mercurial repository. I am allowed to commit to either - and they handle the synchronization between the two. My assumption is that it'd be easier to push to a mercurial repository.
I have a changegroup hook in mind, but I have a few technical questions on how this should work.
What is the best way to handle both receiving and pushing out to an external repository though?
User ----> RhodeCode ----> Redmine
At the RhodeCode step/changegroup hook, how do I forward on my changes? Can I do it directly from the main repository or am I forced to clone it into another directory and push that to the client?
Is there a better way to maintain my master repository and push my client's changes on?
I see no problem with this; the Mercurial hook in Buildbot works this way, doesn't it?

Can't I use hg update offline?

When I use Mercurial and try to do a
hg update --repository C:\Projekt\Learnify\Systems\myapp -rev 271 --check
without network connection I get
"URLError getaddrinfo failed".
Shouldn't I be able to to this since the actual repository is on my computer?
another guess is that you have a subrepository reference in your repository that has an absolute path to a remote location and you are updating to a changeset in your parent repository that references a changeset in the subrepository that you don't have locally, so it is trying to do a pull on that remote repository that is referenced as a subrepository. so what is preventing your update is not a need to connect to a remote repository for your repository itself, but for the subrepository that is referenced absolutely.
try
hg update --repository file://C:\Projekt\Learnify\Systems\myapp -rev 271 --check
to tell Hg it is not a network protocol URI
My guess is that you are using a shared repository (one that cloned with 'hg share' instead of 'hg clone' command). That means the history had been never cloned. You can check for a file '.hg/sharedpath'. If this file exists then actual repo is located elsewhere.
I'd suggest when you'll back online, make another clone of your repository.

Correct command to retrieve remote mercurial updates pushed from my second machine

I'm new to Mercurial.
I initialized a Mercurial project on Machine A, committed my changes and uploaded them to a remote repository.
Then I cloned that repository on Machine B, committed some additional changes and uploaded them to the same remote repository.
In both cases, I uploaded the changes with the same command:
hg push https://username:password#domain/user/repository/
Now I'm back on Machine A and I'm not sure how to update my local repository with the last changes I uploaded to the remote repository from Machine B.
The commands hg clone or hg pull look like they might work but I'm not sure.
Would appreciate any guidance. Thanks.
hg pull will transfer any remote changesets not present in your local repo. Afterwards, you'll need to either hg update or hg merge depending on the presence of local changes.
Use hg pull; pull transfers only changesets which are missing in the existing destination repository.
hg clone creates local copy of a remote repository.
See also this so question.