Code Monkey home page Code Monkey logo

Comments (12)

benoit-pierre avatar benoit-pierre commented on June 1, 2024

Do you have execution rights for git-remote-hg?

from git-remote-hg.

airblade avatar airblade commented on June 1, 2024

Yes:

~/bin/
$ ls -l git-remote-hg 
-rwxr-xr-x  1 andy  andy  35844  9 Dec 13:56 git-remote-hg

from git-remote-hg.

benoit-pierre avatar benoit-pierre commented on June 1, 2024

OK, another case that would match your symptoms: the interpreter for git-remote-hg cannot be found.

Example:

> which git-remote-hg
/home/bpierre/progs/bin/git-remote-hg
> head /home/bpierre/progs/bin/git-remote-hg
#!/usr/bin/python_bad_version

print 'arst'
> git clone "hg::http://selenic.com/repo/hello"
16:25:11> git clone "hg::http://selenic.com/repo/hello"
Cloning into 'hello'...
fatal: Unable to find remote helper for 'hg'

So check it's the correct Python version.

from git-remote-hg.

airblade avatar airblade commented on June 1, 2024

Hmm, I think the interpreter is ok:

$ head git-remote-hg
#!/usr/bin/env python2
#
# Copyright (c) 2012 Felipe Contreras
#

# Inspired by Rocco Rutte's hg-fast-export

# Just copy to your ~/bin, or anywhere in your $PATH.
# Then you can clone with:
# git clone hg::/path/to/mercurial/repo/

~/bin/
$ /usr/bin/env python2 --version
Python 2.7.8

One weirdness though is which doesn't find the script.

~/bin/
$ which git-remote-hg 
(nothing)

I can see how this would mean git can't find the remote helper.

However I have no idea why which can't see git-remote-hg.

from git-remote-hg.

benoit-pierre avatar benoit-pierre commented on June 1, 2024

Yeah, which not finding it is weird. What happen if you call git-remote-hg directly? It should error out with: "ERROR: Not enough arguments.".

from git-remote-hg.

airblade avatar airblade commented on June 1, 2024

Yes, it does:

$ ./git-remote-hg 
ERROR: Not enough arguments.

So I guess git-remote-hg is fine...the problem is somewhere else at my end.

from git-remote-hg.

airblade avatar airblade commented on June 1, 2024

The problem's definitely not with git-remote-hg. I realised that other executables in my ~/bin directory weren't visible to which even though I could execute them.

My PATH starts with .git/safe/../../bin:. This is so that I can run known-safe project executables easily. However it seems to break which's search since removing it makes all of my ~/bin directory, including git-remote-hg visible to which again.

Sorry for the noise and thank you for your help!

from git-remote-hg.

benoit-pierre avatar benoit-pierre commented on June 1, 2024

I notice you're calling it with a relative path, does it work without it? Are you sure your PATH is correctly set?

Also you could try this:

> git --exec-path="$HOME/bin:$(git --exec-path)" clone "hg::http://selenic.com/repo/hello"

from git-remote-hg.

airblade avatar airblade commented on June 1, 2024

I can execute git-remote-hg from anywhere and I get ERROR: Not enough arguments. At the same time which git-remote-hg can't see it.

My PATH starts with the entry I described above, which is a location which only exists in certain directories. I wonder whether which gives up if the first location in PATH doesn't exist.

I tried git --exec-path... and it went further than before...before crashing:

$ git --exec-path="$HOME/bin:$(git --exec-path)" clone "hg::http://selenic.com/repo/hello"
Cloning into 'hello'...
Traceback (most recent call last):
  File "/Users/andy/bin/git-remote-hg", line 1322, in <module>
    sys.exit(main(sys.argv))
  File "/Users/andy/bin/git-remote-hg", line 1286, in main
    repo = get_repo(url, alias)
  File "/Users/andy/bin/git-remote-hg", line 433, in get_repo
    repo.pull(peer, heads=None, force=True)
  File "/usr/local/lib/python2.7/site-packages/mercurial/repoview.py", line 307, in __getattr__
    return getattr(self._unfilteredrepo, attr)
AttributeError: 'localrepository' object has no attribute 'pull'

from git-remote-hg.

benoit-pierre avatar benoit-pierre commented on June 1, 2024

This last error is due to incompatible changes to the Mercurial API in the last version, you need this patch: https://github.com/felipec/git-remote-hg/pull/28/files

from git-remote-hg.

airblade avatar airblade commented on June 1, 2024

Thanks, that patch worked for me.

from git-remote-hg.

airblade avatar airblade commented on June 1, 2024

FYI I posted this as a question on StackOverflow.

from git-remote-hg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.