1

I'm trying to add a repo as a submodule for my project as it will depend on it. The project is hosted on bitbucket, and when I tried to add it using this: git submodule add https://bitbucket.org/blueluna/transmissionrpc, I got the following:

Cloning into 'transmissionrpc'...
fatal: repository 'https://bitbucket.org/blueluna/transmissionrpc/' not found
Clone of 'https://bitbucket.org/blueluna/transmissionrpc' into submodule path 'transmissionrpc' failed

I clicked on the link itself in terminal, which led to a valid link. I'm not sure how to add this in my github repo. It will also give me issues through git clone in both SSH and HTTPS. Note, the original command copied for cloning this repo is as follows: hg clone ssh://hg@bitbucket.org/blueluna/transmissionrpc, which uses mercurial as far as I know.

cellsheet
  • 476
  • 1
  • 4
  • 22

1 Answers1

3

Since it is a mercurial repo, the error is expected: git cannot clone it as a (git) submodule repo.

You would need a git repo in order to add your repo as a (git) submodule.
That would involve a conversion, as mentioned in "Is there a way to use a Mercurial repository as Git submodule?".

The OP cellsheet reports that the conversion part fails with repo.branchtags() unavailable in Mercurial 2.9 , but it can be fixed with the following patch to hg-fast-export.py:

270a271,287

> def legacy_branchtip(repo, heads):
>     '''return the tipmost branch head in heads'''
>     tip = heads[-1]
>     for h in reversed(heads):
>         if not repo[h].closesbranch():
>             tip = h
>             break
>     return tip
> 
> def legacy_branchtags(repo):
>     '''return a dict where branch names map to the tipmost head of
>     the branch, open heads come before closed'''
>     bt = {}
>     for bn, heads in repo.branchmap().iteritems():
>         bt[bn] = legacy_branchtip(repo, heads)
>     return bt
> 
272c289
<   branches=repo.branchtags()
---
>   branches=legacy_branchtags(repo)
> 

Blockquote

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Unfortunately I ran into this issue with git-hg https://github.com/frej/fast-export/issues/20 – cellsheet Mar 21 '15 at 20:31
  • @cellsheet ok, I have included it in the answer for more visibility. Which file is this patch for? – VonC Mar 21 '15 at 20:45