Skip to content

Unable to git-hg clone a repo with "()" in branch name #66

@LudovicRousseau

Description

@LudovicRousseau

git-hg revision 16b573e (latest commit from Nov 2016).
I created a sandbox repository just for this use case.

I guess git-hg does not handle correctly "(" in hg branch names.

$ git-hg clone https://bitbucket.org/lrousseau/sandbox
Initialized empty Git repository in /Users/lroussea/Documents/bitbucket/git-hg/sandbox/.git/
requesting all changes
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 2 files
Initialized empty Git repository in /Users/lroussea/Documents/bitbucket/git-hg/sandbox/.git/hgremote/
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `git rev-parse --verify refs/heads/foo (bar) 2>/dev/null'
Traceback (most recent call last):
  File "/usr/local/lib/git-hg/fast-export/hg-fast-export.py", line 405, in <module>
    options.statusfile,authors=a,sob=options.sob,force=options.force))
  File "/usr/local/lib/git-hg/fast-export/hg-fast-export.py", line 318, in hg2git
    if not verify_heads(ui,repo,heads_cache,force):
  File "/usr/local/lib/git-hg/fast-export/hg-fast-export.py", line 299, in verify_heads
    (_,_,_,_,_,_,branch,_)=get_changeset(ui,repo,h)
  File "/usr/local/lib/git-hg/fast-export/hg2git.py", line 71, in get_changeset
    node=repo.lookup(revision)
  File "/usr/local/lib/python2.7/site-packages/mercurial/localrepo.py", line 1663, in lookup
    node = scmutil.revsymbol(self, key).node()
  File "/usr/local/lib/python2.7/site-packages/mercurial/scmutil.py", line 618, in revsymbol
    raise error.RepoLookupError(_("unknown revision '%s'") % symbol)
mercurial.error.RepoLookupError: unknown revision '???|??;UJ??+9???'

I have:

$ hg branches
foo (bar)                      1:ce1b58f218fa
default                        0:f3e05314a3f4 (inactive)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions