9

I have a local Git repository on my computer that I am trying to clone with Hg-Git. It works fine for me when I'm cloning from a git:// type path, but not if I try to clone from local directories.

Here is an example...

hg clone "C:\Users\James\Documents\My Games\FalloutNV"
destination directory: FalloutNV
importing Hg objects into Git
abort: The system cannot find the file specified

The path does exist, and somehow it knows that it's a Git repo, but it has the direction backwards. It should be importing Git objects into a (new) Hg repo.

Any ideas? I am on Windows, trying to use TortoiseHg but comfortable enough in the command line.


Update

Tonight I discovered that if I rename FalloutNV to FalloutNV.git ... the clone will magically work from the local disk. Just a pointer that may help!

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
jocull
  • 20,008
  • 22
  • 105
  • 149

1 Answers1

5

This is strange since that error message is usually associated with Hg-Git (the dulwich part of it) not finding your ssh key.

That is why manojlds suggested cloning using explicitly the file protocol (except I would use "file:///C:/Users/James/Documents/My Games/FalloutNV" with 3 "/" at the beginning instead of two).

The "A guide to getting the hg-git Mercurial plugin to work on a Windows machine" confirms the ssh issue:

If you’re getting an error like “abort: The system cannot find the file specified”, then dulwich cannot find ssh in your PATH.
You need to make sure to install Cygwin’s OpenSSH and that you can run “ssh” from the command line. (and it also recommend you get the latest version of the dulwich library)


The OP jocull adds in the comment:

Fun fact: Tonight I discovered that if I rename "FalloutNV" to "FalloutNV.git" ... the clone will magically work from the local disk.

And that is similar to the Git protocols page, where every path of a local Git repo ends with .git.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I have an SSH keys generated in the Windows equivalent of `~/James/.ssh` inside `id_rsa` and `id_rsa.pub`. Where do they need to be set for Dulwich to pick them up by default? I use OpenSSH when I use Git, mostly because Putty keys are never in the same format as places like GitHub. – jocull Apr 26 '11 at 13:05
  • I can confirm that it does seem to work properly from the GitBash. Do I need to do any cloning like this from within Cygwin or something instead of the Windows command line? That is slightly more annoying. – jocull Apr 26 '11 at 13:18
  • @jocull: regarding openSSH, I had http://stackoverflow.com/questions/2573571/cloning-a-read-write-github-repository-using-tortoisehg with more details – VonC Apr 26 '11 at 13:24
  • @jocull: regarding git bash, if you are using msysgit (http://code.google.com/p/msysgit/downloads/list), no Cygwin should be needed. See http://stackoverflow.com/questions/4821372/does-git-on-windows-use-mysys/4821920#4821920 and http://stackoverflow.com/questions/3144082/different-between-msysgit-and-cygwin-git/3144417#3144417 – VonC Apr 26 '11 at 13:25