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://[email protected]/blueluna/transmissionrpc, which uses mercurial as far as I know.

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

2 Comments

Unfortunately I ran into this issue with git-hg github.com/frej/fast-export/issues/20
@cellsheet ok, I have included it in the answer for more visibility. Which file is this patch for?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.