I have managed to clone my repository locally via the TortoiseHG gui. What i would like to know is how to do this via the command prompt. In TortoiseHG's clone window, there is a Hg command line containing the following:
hg clone --verbose -- C:...\Mercurial Demo\Shared C:...\Mercurial Demo\Bob
Ive tried copying this into the command prompt but it doesnt work. It states the clone command should follow the following structure:
hg clone [OPTION]... SOURCE [DEST]
hg clone help wasnt any help either.
id appreciate it if someone could show me an example of how this should be done.
Thanks.
My overwhelming suspicion is that the path has spaces in it, so Mercurial is seeing far too many options. Try enclosing the paths in quotes.
Related
trying to clone the cooliris project using the command provided by Google;
hg clone https://cooliris-toolkit.googlecode.com/hg/ Cooliris-ToolKit
but it runs though and always fails with
updating to branch default abort: No such file or directory
whether I had created the folder Cooliris-ToolKit or not.
Can anyone suggest solution for this please?
Thanks.
Here is a working command:
hg clone https://cooliris-toolkit.googlecode.com/
https://code.google.com/p/cooliris-toolkit/source/checkout
all,
I have searched for this problem for long time and tried different methods.
I want to maintain my code on the server through only SSH. But when I run this:
sudo hg clone -v ssh://carl#hostname//home/carl/Java/Projects/peta/
Mercurial keeps telling me remote: abort: There is no Mercurial repository here (.hg not found)!. Some articles said that the path should be correct and there should be a .hg directory there. But I have checked it for several times and I am sure there is a .hg folder at the right place.
I also tried
hg --config ui.remotecmd=/usr/bin/hg clone ssh://carl#hostname//home/carl/Java/Projects/peta/
But it failed as well. What other problem it could be? Thanks.
Solved
I finally fix the problem. Previously, I create a repository on my local machine, and scp all files (including .hg) on to the server. I try to remove .hg directory first, and create a repo on the server through ssh (hg init). Then hg clone works!
Extraction from hg help urls
Some notes about using SSH with Mercurial:
SSH requires an accessible shell account on the destination machine and
a copy of hg in the remote path or specified with as remotecmd.
path is relative to the remote user's home directory by default. Use an
extra slash at the start of a path to specify an absolute path:
ssh://example.com//tmp/repository
this means, at least, that you can't use the same URI and change only one/two slash it it: at least one path will be non-existent.
Consequence of the quote and error message: you must to debug (with any ssh-tool) and find correct path to needed directory. you can:
use scp (f.e) and copy known file from known location
SSH into remote host in interactive session and verify path (both?) by hand, i.e: ssh ..., cd ..., pwd, verify output of pwd
... any other debugger
When you'll get good path after login, you have to check next point of failure - .hg dir permissions
After verification of these checkpoints you'll get clone and some bonus in the form of understanding "What happened before"
HTH
I don't know if this really helps but, according to the FAQ:
hg clone ssh://USER#REMOTE/path/to/repo
They are using only one / after the USER#HOST. Maybe you can try that way.
César Bustíos's answer is almost correct, but that tries to clone from remote to local. To opposite way, we have to add the local path. In the case it is the current directory, it will be a dot.
hg clone . ssh://USER#REMOTE/path/to/repo
Hope it helps. :)
Running on Debian, to solve my problem, I have added the following line to my /var/lib/mercurial-server/.mercurial-server configuration file after the [paths]
[paths]
/ = ~/repos
...
And don't forget to issue this command afterwards: sudo -u hg /usr/share/mercurial-server/refresh-auth
This might be an extremely stupid question, but for the life of me, I cannot figure out how to download this:
http://code.google.com/p/xmppframework/source/browse/#hg%253Fstate%253Dclosed
There is nothing under the "downloads" tab. And when I try to "clone" it using my terminal it says "HG command not found".
Any ideas??
hg is the executable for Mercurial, you're going to need to download and install Mercurial.
Once you have it installed you can use it to clone the project:
hg clone https://xmppframework.googlecode.com/hg/ xmppframework
https://www.mercurial-scm.org/guide please visit this link.....right now i successfully install mercurial but next step not i am clear.....
Initialize the project
Now you add a new folder in which you want to work:
$ hg init project
Add files and track them
$ cd project
$ (add files)
$ hg add
$ hg commit
(enter the commit message)
add file means i dont know...can u explain please
now i am using ubuntu....
mercurial installation step1:
embdes#embdes-laptop:~$ sudo apt-get install mercurial
[sudo] password for embdes:
Reading package lists... Done
Building dependency tree
Reading state information... Done
mercurial is already the newest version.
The following packages were automatically installed and are no longer required:
libopenal1 wavpack kdelibs4c2a libdc1394-22 mppenc vorbis-tools libxvidcore4
libldns1 libsvga1 kdelibs-data mplayer kdemultimedia-kio-plugins liblualib50
libkcddb4 mp3gain vorbisgain speex libmp3lame0 faad libavahi-qt3-1 icedax
freepats ffmpeg libao2 liblzo2-2 libavfilter0 flac libev3 timidity libqt3-mt
liblua50 timidity-daemon libunbound2 libavdevice52
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 261 not upgraded.
embdes#embdes-laptop:~$
step:2
embdes#embdes-laptop:~$ hg init project
abort: repository project already exists!
embdes#embdes-laptop:~$ cd project
embdes#embdes-laptop:~/project$ hg add
embdes#embdes-laptop:~/project$ hg commit
nothing changed
embdes#embdes-laptop:~/project$ hg init
abort: repository . already exists!
embdes#embdes-laptop:~/project$
This is the output from my commandline. Please correct me if I have done anything wrong.
The android project I develop will reside in the following directory,
/home/embdes/workspace
The following is the android sdk directory
/home/embdes/project/android/android-sdk/platform-tools/
how to install mercurial?
how to use android engine example project in my eclipse?
I am new in using commandline, so please help me in clearing above two doubts.
Thanks
You need to create files that are going to be version controlled. It is that simple.
You will find a full step-by-step tutorial at hginit
For instance, after an hg add, you need an hg commit:
There’s still one more step… you have to commit your changes. What changes? The change of adding all those files.
Why do you have to commit?
With Mercurial, committing says “hey, the way the files look right now—please remember that.” It’s like making a copy of the whole directory… every time you have something that you’ve changed that you sorta like, you commit.
When you issue the init command you are telling mercurial to track changes within the directory for a list of files... with the add command you tell mercurial which are these files.
By issuing the add command without any parameters you're telling mercurial to revision-control ALL the files within the "project" directory (recursively).
At any given time you can "forget" a file... and it will still be within "project" (directly or not) but mercurial won't care about any changes to the file.
You have to first get a basic understanding of what mercurial is for. Mercurial is a version control system which can store the changes you make your files. In your commandline output it is obvious that you have no files inside the,
/home/embdes/project
directory. That means you have made no change. Then what will mercurial store?? So only it says nothing has changed. You just create new files or directories there. Then do hg add. You will see the difference :)
I created a repository on a remote machine using:
hg init
hg add
hg commit
The repository was created.
I cloned the repository on a local machine with no errors reported; The files seem to be there
Now I'm trying to make a clone of the clone (as a working copy) using:
hg clone "path to original clone"
It returns:
destination directory: "name of repository"
abort: No such file or directory: "path to original clone"/.hg/store/lock
What am I doing wrong?
Thanks
What filesystem is used on the partition where the main repository is ?
Actually, when Mercurial is doing some operations, it needs to lock the repository. For doing this it creates a symbolic link to an nonexistent file, when the filesystem supports it, in the .hg repository, telling every other processes that the repository can't be modified at this time. When symbolic links aren't supported by the filesystem, a normal file is created.
However, there's some problems with some FUSE filesystems, typically SSHFS with the follow_symlinks option activated. FUSE reports that he knows about symbolic links, but since SSHFS follows the symbolic link and the file doesn't exist, the "state" of the link is marked as unknown thus Mercurial thinks the repository isn't correctly locked and abort the operation.
I see you're using Cygwin, so maybe it's the same kind of problem with tools designed for UNIX on a windows filesystem. It's a strange, coworkers of mine are using Mercurial via Cygwin just fine.
I don't know if it's the case for you, but I lost nearly half a day on this problem. Maybe this answers can help some people in the future.
Please paste in the actual command that's failing and the output including the actual path to the clone that you're cloning. When you do the clone use --debug and --traceback too.
As a workaround you can can always try hg init newclone followed by hg pull -R newclone pathtooriginalclone, which is effectively equivalent except it doesn't use local hardlinks when possible.