Pull a web repository into local using Mercurial command - mercurial

I'd like to pull a Mercurial web repository into my local filesystem to work. I used the following command but I get the error: Merucrial Repository (.hg directory not found). But my boss said Mercurial is installed in the machine.
hg pull https://username#web_repository_name
What is the proper way to get a working copy of a Mercurial repository?

You need to start by executing a clone of the repository, after which you can use pull to incrementally add new changes.
These are really the basics of Mercurial, so I would propose you read this tutorial, followed by this Mercurial guide.

Related

Mercurial repository corruption repair says it's not a mercurial repository?

So I have managed to corrupt my mercurial repo. So I am following the steps from the repository corruption page on the wiki to repair it.
When I run the convert command:
hg convert --config convert.hg.ignoreerrors=True REPO REPOFIX
It gives me the following output:
initializing destination REPOFIX repository
REPO does not look like a CVS checkout
REPO does not look like a Git repository
REPO does not look like a Subversion repository
REPO is not a local Mercurial repository
REPO does not look like a darcs repository
REPO does not look like a monotone repository
REPO does not look like a GNU Arch repository
REPO does not look like a Bazaar repository
cannot find required "p4" tool
Why on earth would it say that? And how can I go about fixing it?
It definitely is a mercurial repository, it's hosted on Bitbucket, and I am using Tortoisehg to manage it.
Edit:
I think maybe I can't do this against a remote repository? How can I go about fixing this then?
You probably did not corrupt the remote repository at Bitbucket, did you?
It's more likely you corrupted your local copy, and so you can just clone it from Bitbucket again or try the hg convert … trick on your local copy (i.e. the folder you manage with TortoiseHG).
A bit late but I faced the same issue. The mistake was running that command inside the project folder. You have to run the command outside the folder containing the .hg file. I could not find a way through TortoiseHg console to move up a directory so I used windows terminal.

Clone Google Code Project

When I try to download a project from Google Code using TortoiseHg I got the following message:
abort: 'svn' executable not found for subrepo 'mobile/ios/externals/google-toolbox-for-mac'
I am using this link google.code
EDIT: I am running Windows XP
The repository you're trying to clone as some Subrepository defined which are on a Subversion repository. The subrepository list can be seen in the .hgsub file.
In order for the clone to work, you will need to install Subversion on your computer. You can find packages for various platform here : http://subversion.apache.org/packages.html
The executable must also be in the path so Mercurial can use it. Since you didn't give much details about your environment, I can't help you with that, but I think the installation process should take care of this.
FYI, Mercurial also handles Git subrepository, so if you want to clone a project which make uses of them, you will also have to install Git.

External mercurial repository in redmine?

Is this possible to have external mercurial repository in redmine just like svn?
For svn i've got following configoration options and it work with external repos:
For mercurial i can only enter local path to repository:
I don't think this is possible, you will need a local clone as stated in the Redmine documentation:
Mercurial repository
To synchronize with a Mercurial
repository, you will have to have a
local clone of the repository on the
same server you have Redmine installed
on. Let's say you put Redmine in
/var/www/redmine.example.com/www and
have put your mercurial repository in
/var/www/sources.example.com/repo/example,
you would have to select Mercurial as
a SCM, then enter
/var/www/sources.example.com/repo/example
in the repository text box.
A similar question has been asked in the Redmine forums. You'll need to set up a local clone and update it automatically, e.g. by using a cron job.

How do I push a new project to a shared Mercurial multi-repository?

I have a local machine ("laptop") and a shared Mercurial repository on another machine ("server").
The shared repository is set up as a multi-repository as described in the Mercurial documentation using Apache, the hgwebdir.cgi script and Mercurial 1.4.
The setup works in the sense that I can browse the projects (repositories) in the web browser, I can clone and pull from the server, and I can push from the laptop when the project/repository already exists on the server.
But I cannot create a new project on the laptop (hg init, do stuff, hg commit) and push it to the shared multi-repository (hg push http://server/hg/my-new-project-name) - I get "abort: HTTP Error 404: Not Found", presumably because the directory/project repository does not exist yet.
How can I push a new project/directory structure to a Mercurial running elsewhere? I couldn't find anything in the documentation, how do you guys do it?
You cannot create new remote repositories over http with the built-in functionality. Your options are to either:
create with a ssh clone: `ssh clone local-repo ssh://you#remote//path/to/repo'
log in to the remote repo and do a hg init where you want the repo. After that you can push to the new empty repo
Use a cheesy http-creation CGI like the one I wrote here: http://ry4an.org/unblog/UnBlog/2009-09-17
Update
I tried using Dropbox as described below, but couldn't make it sufficiently reliable, so I'm not recommending that option.
Original answer below, kept for context.
/update
I found one more option: Skipping both http and ssh altogether and using Dropbox for shared repos.
For the one-person-multiple-computers scenario, it looks like the simplest option of the lot, and you get backups as a nice side effect.
Here is a discussion on Hacker News

How to initialize google-code project in Mercurial

I have started a Mercurial based project on google code.
I have worked in subversion for sometime, but I am confused with what to do what in Hg.
I would like help on the following:
How do I initialize project (first on my local machine) (then from my local copy to google's server)
How do I get my copy of a build from the server
How do I update(merge/sync) my local changes back to the server
My project is in PHP and I am using netbeans
Both barkmadley and RC touch on it, but what you're explicitly missing is that your order is wrong in step one. Create the empty repo on google, clone it to local, and then commit locally and push. Don't try to create it locally and then push to google. There's nothing inherently wrong with the idea of doing it that way, but it's not the workflow for which google is set up.
For what it's worth, I wrote a blog post about Managing a Google Code project with Mercurial
Here's some infos:
For #1: initialize the project on google-code, then clone the repository locally (hg clone ...), add you files to the directory created by the clone process and commit that (hg commit -m 'your message' then push (hg push).
For #2: see #1
For #3: to update you local copy (hg pull -u) and to commit your change hg commit followed by hg push
As mentioned by barkmadley, Hg Book is worth reading
Hg Book should help.
when you create a project you can select the version control system used.
from there you should be able to get hg clone instructions from google code on the downloads tab.
this will give you an initial checkout of the system. Then you copy your work into it, and hg push and hg pull to sync between the google repository. To save changesets to your local copy use hg commit
Try reading this user contributed wiki. It is quite straigtforward I reckon.